Skip to content

Expose procedures via CLI, API or HTTP using a single definition

License

Notifications You must be signed in to change notification settings

launchdeckio/shipment

Repository files navigation

shipment

Define-once, run-everywhere realtime operations framework

Build Status NPM Version

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

dependency Status devDependency Status

About

Expose procedures via CLI, API or HTTP using a single definition

Resources

License

Stars

Watchers

Forks

Packages

No packages published