0.0.3 • Published 11 years ago

ode v0.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
11 years ago

Ode

Codeship Status for xaviervia/ode

Zero overhead CLI adapter for Node modules.

// greeter.js
module.exports = function (options) {
  console.log("Howdy, " + options.name + "!");
  console.log(options.number * options.factor);
  if (options.verbose === true) {
    console.log("Features: Numbers are casted to numbers\n" +
                "unassigned flags are casted to `true` values\n" +
                "otherwise the value is taken as string");
  }
}
ode greeter --name=Johnny --number=2 --factor=4 --verbose

It can also be used programmatically to make CLIs out of your modules:

var Ode = require("ode");
var yourModule = require("your-module");

Ode(process.argv, function (options) {
  yourModule(options);
});

Installation

npm install -g ode

CoffeeScript

Because it is so widespread, Ode comes with support for CoffeeScript out of the box. If you want to use another dialect/transpiler, please pull request.

Testing

Clone this repo and run

npm test

License

Copyright 2014 Xavier Via

ISC license.

See LICENSE attached.

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

2.0.0

11 years ago