component-api

API for creating, building, and installing components

component-api

API for creating, building, and installing components. If you're looking for a command line interface, see component(1)

$ npm install component-api
var api = require('component-api');

Build a component in the given directory.

  • directory:string - The directory containing the component you wish to build
  • options
    • dev:bool - Build development dependencies
    • standalone:string - Triggers a standalone build with the given name as the global created
    • out:string - The output directory for built files, defaults to ./build. You can alternatively pass an object {js: Stream, css: Stream}
    • name:string - Base name for build files defaulting to build
    • prefix:string - prefix css asset urls with prefix
  • callback(err, duration) - Callback called when complete with the time taken to build the components or an error if something went wrong.