-
Notifications
You must be signed in to change notification settings - Fork 279
Docs | Creating Extensions
dc edited this page Jan 26, 2016
·
1 revision
Creating and publishing a Vorpal extension is simple. Simply expose your module as a function which takes two parameters - vorpal and options. When your module is imported by vorpal, it will pass itself in as the first object, and so you are free to add any commands or configuration that vorpal supports.
module.exports = function(vorpal, options) {
vorpal
.command("foo", "Outputs 'bar'.")
.action(function(args, cb){
this.log("bar");
cb();
});
// ... more commands!
}The options exist so the user can pass in customizations to your module. In documenting your vorpal extension, you would lay out your supported options for the user.