Skip to content
Parse command-line arguments into your NodeJS applications.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
LICENSE.md
README.md
package.json

README.md

node-opt

Parse command-line into your NodeJS applications.

node-comline - is a small command-line parser for your NodeJS application.

Installation

npm install node-comline

Bit more detail

Parses your command-line arguments and returns an object with them all in.

Usage

var com = require('node-comline');

// The module provides a single function to interact with, that simply returns
// all arguments parsed when the application was run

// By default, "-" and "--" are removed from the begining of
// the arguements provided; so "--that=argument" will return
// {"that":"argument"}

var config = {"removesingles":false, "removedoubles":false};
// Do this to turn that off

//The core function, set to "com()" in this case...
// Will directly return an object of arugment and value pairs

// So...

console.log(com());
// Will return an [object], without any configuration

// Whereas...

console.log(com(config));
// Will return an [object], and take into account the above created configuration

License

Creative Commons Licence
NodeOpt by Darren Looby is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at https://github.com/darrenlooby/node-comline.

Something went wrong with that request. Please try again.