component-wrapper

Small module that spawns component.js as a child process

Component Wrapper

Small wrapper that calls the component.js executable using child_process.spawn.

npm install component-wrapper
var component = require('component-wrapper');
component([args], [options]);
 
// Calls spawn once or multiple times depending on the length of the args array 
 
require('child_process').spawn('/node_modules/component/bin/component', [args], [options]);
component();
 
// This defaults to [ ['install'], ['build'] ] so this calls. 
 
require('child_process').spawn('/node_modules/component/bin/component', [ 'install' ], null);
require('child_process').spawn('/node_modules/component/bin/component', [ 'build' ], null);
component([ [ '--help' ] ]);
 
// Calls spawn once: 
 
require('child_process').spawn('/node_modules/component/bin/component', [ [ '--help' ] ], null);
component([ [ '--help' ], [ 'search', 'font-awesome' ] ], { cwd: __dirname });
 
// Calls spawn twice: 
 
require('child_process').spawn('/node_modules/component/bin/component', [ [ '--help' ] ], { cwd: '/some/directory' });
require('child_process').spawn('/node_modules/component/bin/component', [ [ 'search', 'font-awesome' ] ], { cwd: '/some/directory' });