Write
If you have a library and you want to share with the other programs, it’s time to create a module. It’s very simple but you have to known some rules.
Structure
lib
This folder contains all the files responsible for the functionality of your module.
node-modules
This folder contains all the dependencies(other modules) used to implementation. This is created automatically when you install some modude.
tests
Contains all tests arquives to test your module.
LICENSE
This file contains all informations about the license of module.
package.json
This is the most important file, allows to see all information about this module, structure, owner e etc.
README.md
This is a markdown file, contains all information how to use de module, version and example the code.
Publish
NPM REGISTRY
First you have to go to https://npmjs.org/signup and create account and user.
npm adduser
Now you need add user to publish your module.
npm publish
Now you have to go to root of your module and use this command.
Now your module was published and you can download from npm and install in other project.
Updated May 12, 2020 2020-05-13T06:35:06+08:00