Forum

Methodology

Toolbox

Platform

Community

bem-tools

bem-tools is a CLI runner for its plugins.

Plugins are npm packages exporting COA command. By convention they should be named with bem-tools- prefix so bem-tools may find them among other packages.

Plugins

Each plugin provides JS API and exports COA command via cli.js file to be used with bem-tools.

Available plugins list

List of work-in-progress plugins

How to create your own plugin

  1. Plugin should be named with bem-tools- prefix.
  2. By convention each plugin should be available as JS API (so it may be used without bem-tools). You may export plugin functionality from index.js file in the root of your package.
  3. Plugin should provide COA command via cli.js file (it ):
    module.exports = function() {
     this
         .title('Title of your plugin').helpful()
         .opt()
             .name('foo').short('f').long('foo')
             .title('Foo')
             .end()
         .arg()
             .name('bar').title('Bar')
             .arr()
             .end()
         .act(function(opts, args) {
             console.log(opts.foo, args.bar);
         })
         .end();
    };
    
    
    For more info about COA please refer to https://www.npmjs.com/package/coa.

See also

If you notice a mistake or want something to supplement the article, you can always write to us at GitHub, or correct an article using prose.io.