shipment
v12.1.1
Published
Define-once, run-everywhere realtime operations framework
Downloads
22
Maintainers
Readme
shipment
Define-once, run-everywhere realtime operations framework
Install
$ npm install shipment@next
Usage
const Shipment = require('shipment');
const {Cli, HttpServer, ApiWrapper} = Shipment;
const shipment = new Shipment({
toUpper({args: {message}}) {
return message.toUpperCase();
},
});
// Expose a CLI
new Cli(shipment.cli()).run();
// $ node ./my-module.js to-upper --message bar
// Or expose an HTTP server
new HttpServer(shipment).listen();
// $ curl -X POST -d '{"message": "bar"}' http://localhost:6565/to-upper
// Or simply a Node.js module
module.exports = new ApiWrapper(shipment).proxy;
// console.log(require('./my-module.js').toUpper({message: "bar"}));
License
MIT © sgtlambda