Creación del proyecto
mkdir gds && cd gds
npm init -y
Instalación de paquetes
npm i clear
npm i figlet
Creación de index.js
#!/usr/bin/env node
const figlet = require('figlet');
const clear = require('clear');
clear();
console.log(figlet.textSync('GDS'));
Test básico
node .
o
node index.js
Modificar package.json
{
"name": "gds",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": "./index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Gabriel Sule",
"email": "gabrielsule@gmail.com"
},
"license": "ISC",
"dependencies": {
"clear": "^0.1.0",
"figlet": "^1.5.0"
}
}
Instalar modo global (prueba)
npm link
Test
gds
Publicación en NPM
npm publish