Local Proxy for NCM 2.0.
This is a simple proxy server that is run locally on the computer doing the npm
installations. When an install happens it will use the NCM API to look up score data and then either just log what was done or rewrite the proxied results to prevent installs of non-certified information.
Start an ncm proxy server on port 14313
(14
=N, 3
=C, 13
=M):
$ NCM_TOKEN=xxx npx @nodesource/ncm-proxy
To obtain an ncm token please see the docs.
Then configure as your npm registry:
$ npm install express --registry=http://localhost:14313
Set the PORT
environment variable to launch on a different port:
$ NCM_TOKEN=xxx PORT=8080 npx @nodesource/ncm-proxy
You can also use a different registry than the default https://registry.npmjs.org/
:
$ NCM_TOKEN=xxx npx @nodesource/ncm-proxy https://registry.npmjs.org
All except listed routes are simply proxied through:
Rewrite tarball urls to point at the proxy.
Return 404
if the module has a score lower than 85 or is on the whitelist,
otherwise proxy through.
Copyright © NodeSource.
Licensed under the MIT open source license, see the LICENSE file for details.