1.0.1 • Published 10 years ago
learn-npm-hello v1.0.1
Hello World package for NPM registry
Steps Taken
- Create account on NPM website or on CLI with
npm adduser
- check by hitting
https://www.npmjs.org/~<username>
- Create new module/package
npm initto setup the basic package.json information- create/test the code
- Authorize the development machine using
npm login - Publish to registry with
npm publishin the project directory - Check
http://npmjs.com/package/<package> - Finally run
npm install <package>to ensure the package is available for use
NPM Package Requirements
Reference NPM doc
- package.json
- name and version in the package.json file
Quick NPM Commands
npm config lsornpm get- show the current configuration information pulled from .npmrc
npm publish- publish the current directory's package
npm publish --tag beta- publish to NPM with the latest tag, so it will not be auto installed
npm version <patch|minor|major>- bump the package.json version information
- if executed in GIT repository, it will auto-create a tag as well
npm pack- create a package - ZIP - of the project locally
- local install for testing with
npm install <zip file name (absolute/related) path> npm install <package name>npm uninstall <package name>