Wednesday, 3 February 2016

Publish node module to access by NPM command

Publishing public node module is easy process like some command and you have it

  • create directory "demo-example-package"
  • cd demo-example-package
  • npm init 
    • type module name, description, version, author, entry point,etc.. 
  • create file index.js which is entry point of your module

I share one example module on https://www.npmjs.com/package/n-random, take it as example and right yout own code in to index.js and your have your module ready to go.

now publish this by : npm publish 

you can simply import your module by npm command like as like as other module.

npm install demo-example-package

for more information you can refer youtube video : https://www.youtube.com/watch?v=3I78ELjTzlQ  





No comments:

Post a Comment