Use Node to write a command line tool Back

First step is to add bin attributes in package.json

In the following case, this comand line is named cls

{
    "bin": {
        "cls": "lib/start.js"
    }
}

Then create a script start.js for this

#! /usr/bin/env/node

console.log('cls command');
sudo npm link

Uninstall

sudo npm rm --global cls

results matching ""

    No results matching ""