The idea is to be able to download this module by npm install
and be able to execute this package:
npm install nome-do-modulo --save
Once downloading could run on my project as follows:
nomeDoModulo = require('nome-do-modulo')
The idea is to be able to download this module by npm install
and be able to execute this package:
npm install nome-do-modulo --save
Once downloading could run on my project as follows:
nomeDoModulo = require('nome-do-modulo')
The steps to take are:
npm init
This will create a package.json
and will ask you a number of things about the module you are creating.
Then I usually tag the code (give it a version), after committing with:
git tag 1.0.0
and to send to npm:
npm publish
If you do not already have an account you can create it on the site and then use npm login
on the command line, or directly npm adduser
and then npm publish
.
As I already have account for some time I do not remember the questions to ask but these steps should take you there.