[go: nahoru, domu]

hoagie

3.4.1 • Public • Published

hoagie

express-like organization for command-line applications.

NPM version Build Status

Install

$ npm install hoagie --save

Usage

// math.js
 
var hoagie = require('hoagie');
 
var app = hoagie();
 
app.use('add', function(req, res, next) {
    var a = parseInt(req.params[1], 10);
    var b = parseInt(req.params[2], 10);
 
    res.send(+ b);
});
 
app.run(hoagie.argv);
$ node ./math.js add 1 1
2

See the examples directory for more code samples.

app.use([command, ]fn...)

Adds each middleware function to the stack, optionally under the command space. Each middleware should be a function of the signature function(req, res, next).

Middleware

License

ISC License

Package Sidebar

Install

npm i hoagie

Weekly Downloads

6

Version

3.4.1

License

ISC

Last publish

Collaborators

  • jeremyruppel