lib/functions/use.js
function use(plugin, options){
  utils.assertString(plugin, 'plugin');

  if (options) {
    utils.assertType(options, 'object', 'options');
    options = parseObject(options);
  }

  // lookup
  plugin = plugin.string;
  var found = utils.lookup(plugin, this.options.paths, this.options.filename);
  if (!found) throw new Error('failed to locate plugin file "' + plugin + '"');

  // use
  var fn = require(path.resolve(found));
  if ('function' != typeof fn) {
    throw new Error('plugin "' + plugin + '" does not export a function');
  }
  this.renderer.use(fn(options || this.options));
}
function use(plugin, options){
  utils.assertString(plugin, 'plugin');

  if (options) {
    utils.assertType(options, 'object', 'options');
    options = parseObject(options);
  }

  // lookup
  plugin = plugin.string;
  var found = utils.lookup(plugin, this.options.paths, this.options.filename);
  if (!found) throw new Error('failed to locate plugin file "' + plugin + '"');

  // use
  var fn = require(path.resolve(found));
  if ('function' != typeof fn) {
    throw new Error('plugin "' + plugin + '" does not export a function');
  }
  this.renderer.use(fn(options || this.options));
}
function use ( plugin , options ) { utils . assertString ( plugin , 'plugin' ) ; if ( options ) { utils . assertType ( options , 'object' , 'options' ) ; options = parseObject ( options ) ; } // lookup plugin = plugin . string ; var found = utils . lookup ( plugin , this . options . paths , this . options . filename ) ; if ( ! found ) throw new Error ( 'failed to locate plugin file "' + plugin + '"' ) ; // use var fn = require ( path . resolve ( found ) ) ; if ( 'function' != typeof fn ) { throw new Error ( 'plugin "' + plugin + '" does not export a function' ) ; } this . renderer . use ( fn ( options || this . options ) ) ; }
Use the given `plugin`

Examples:

use("plugins/add.js")

width add(10, 100)
// => width: 110
Use the given plugin