2.0.14 • Published 4 years ago
npm-test-starter-milosz v2.0.14
This module is created for testing purposes! The real thing is coming soon :)
Start
Main project - npm-test-starter-milosz
Running the script
node index.js
Publish to npm
- update package.json version
npm release major | minor | patch
- run
npm publish
Documentation
A guide to creating a NodeJS command-line package
An easy to understand scaffolding script
shelljs - terminal commands in node shelljs cheatsheet
NPM
For the lazy one here is a bunch of videos on how to publish to npm npm videos
installing npm
- register to npmjs.com
- login in terminal
npm login
&npm whoami
Creating a npm package
Creating a npm package.json
To create a default package.json using information extracted from the current directory, use the npm init command with the --yes or -y flag. Initiate package.json npm init --yes
or npm init
How to release to npm
Create a basic package.json file
{
"name": "npm-test-starter-milosz",
"version": "1.0.0",
"description": "a simple test",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"test"
],
"author": "Milosz Hygen <miloszhygen@gmail.com>",
"license": "ISC"
}
Create an index.js
file with exports code
exports.printMsg = function() {
console.log("This is a message from the demo package");
}
run npm publish