hab-client
Version:
Promise-based habitat client that mostly just executes the hab binary but can also query the supervisor API
20 lines (11 loc) • 391 B
JavaScript
const Hab = require('./lib/Hab.js');
// create a default instance
const hab = new Hab();
// expose exec function for default instance as export
module.exports = function () {
return hab.exec.apply(hab, arguments);
};
// expose default instance as prototype of exported exec function
Object.setPrototypeOf(module.exports, hab);
// expose class prototype
module.exports.Hab = Hab;