npm-login-with-param
v1.2.1
Published
Login into npm from the non-interactive CLI
Downloads
70
Readme
npm-login-with-param
A simple script to login into npm from the command line, in case you don't have
an interactive shell, expect or anything fancy. This package extends the great work Arian Stolwijk did by allowing you to provide parameters to the login process. Very handy for docker builds
Usage
With parameters
npx npm-login-with-param -u john -p secret -e [email protected]or
npx npm-login-with-param --username john --password secret --email [email protected]With environment variables
export NPM_USER=john
export NPM_PASS=secret
export [email protected]
npx npm-login-with-paramnpm login --auth-type=legacy
If you are using the npm CLI version 9.0 or greater and you are logging in to a private registry
you will almost certainly need to use the --auth-type=legacy option of npm.
See: npm login auth-type
To use --auth-type with this simple script, use a space and not an equal sign:
npx npm-login-with-param --auth-type legacy --username john --password secret --email [email protected]How it works
It's a simple child process that reads/writes from/to the stdout/stdin.
