As a contributor of some packages on npm, I will try my best to give you some tips on how to publish package on npm.
Node package manager is the official package manager for nodejs. npm doc
You must use Semver versioning for your package.
devDependencies key in your
package.json to define dependencies needed in your build or test process.
Install package as dev dependencies :
npm install <package-name> --save-dev
You must put your test framework, grunt|gulp plugins, jshint, in
You can use a
.npmignore file at the root of your project to keep your files and directories out of your package. For example, tests and demo directories can be excluded.
.npmignore example file
Before publishing your node package, it's really interesting to test it installed, globally or in another project.
Global module, if your package define global module you can install this using.
cd your_module_directorynpm install . -g# Test
You can also test your module in another project using this command:
cd test_projectnpm install you_module-directory# Test