I'm practicing my English ability lately in order to be recruited by a foreign company for my next job-hopping,if there is anything that I did't express precisely, please pardon me.javascript
e.g:/d/sayHelloWorld
java
You will set name, descrption, entry point and etcetera for your Node.js module.
When you are done, there will be a new file in your directory called "package.json", which contains all of the information you just set.
entry point: your entry file of your Node.js module.
test command: the command that you need to execute your unit test.npm init
node
e.g:/d/sayHelloWorld/index.js
shell
module.exports = { say() { console.log('Hello World!') } }
npm install [Node.js Module Path] // e.g: npm install ../sayHelloWorld/
node var test = require([Node.js Module Name]) // e.g: var test = require('sayhelloworld') test.say() // write out 'Hello World'
Related:
Publish a Node.js Module to the NPM Registry
Install Pakages Using NPMexpress