Skip to content

Instantly share code, notes, and snippets.

@gturi
Created October 9, 2022 10:59
Show Gist options
  • Save gturi/a3b47ccfc1549a04e3c77274ec6edb24 to your computer and use it in GitHub Desktop.
Save gturi/a3b47ccfc1549a04e3c77274ec6edb24 to your computer and use it in GitHub Desktop.

Useful npm commands

Test packages without deploying to npm registry

# create your local registry # I.E. $HOME/Desktop/local-npm
LOCAL_REGISTRY='/path/to/local-registry' # I.E. $HOME/Desktop/local-npm
mkdir "$LOCAL_REGISTRY"

cd '/path/to/your/program'

# package your program
npm pack --pack-destination "$LOCAL_REGISTRY"

# globally install in your system
npm install -g "$LOCAL_REGISTRY/$YOUR_PACKAGE.tgz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment