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).
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 usesnpm config get registry
to fetch the actual registry thatnpm
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)