mozilla / npm-lockdown

Lock down your npm dependencies by shasum.
Mozilla Public License 2.0
207 stars 30 forks source link

Use npm, not process environment, to determine registry before starting server #45

Closed jackwanders closed 3 years ago

jackwanders commented 9 years ago

process.env['NPM_CONFIG_REGISTRY'] accounts for cli level custom registries, but not for package or user level registries (defined in .npmrc). This pull request uses npm config get registry to fetch the actual registry that npm will use, and properly parses it to support registries with custom ports and paths (e.g. Nexus npm registries).

Because the majority of the existing code became nested within an exec call, I would recommend viewing the diff with whitespace changes hidden (https://github.com/mozilla/npm-lockdown/pull/45/files?w=1)