Module publish in Node.js




To upload or module  to npm repository we need to create a user account
command : npm adduser

To push our own module in to npm repository  we need to create the package json file. For that we have to do some step to complete

1) Go to project folder using terminal and command
npm init

2) This will create a package.json Which contain all the details about the module. During the process fill the detail that system asks

3) After creation of the user upload using
command : npm publish

4)Tthen we can search the packate in npmjs.org location with our module name.

NOTE: The module can be updateable using the npm publish command .but now we have to change the version in package.json file. After the change of version simply update the module using npm publish

1 comment: