1.0.2 • Published 4 years ago

node-module-example-of-thsi v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Node-Module-Example

npm GitHub npm

1. Create package.json

npm init

Note: define your module name in name field of package.json.

2. Define a entry file

entry is a file that return object method for the require('your_module_name') call.

Can be config in main field of package.json

3. login your npm account

npm login
npm whoami

4. Publish your module

npm publish

5. Install and Use your module

# Anthor directory
npm install your-package-name
const myModule = require('your-package-name');
myModule();

Notice:

  1. If it occurs an error message that you do not have permission to publish "your module name", Are you logged in as the correct user?, that means this module had alredy existed.
  2. If you update module and want to republish, you must update your module version file in package.json, you can use the npm cli npm version major/minor/patch.
  3. Your registry config must be http://registry.npmjs.org, or you can config it a Github npm registry by https://npm.pkg.github.com.
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago