UNPKG

400 BJavaScriptView Raw
1const { sync: spawnSync } = require('cross-spawn');
2const path = require('path');
3
4const CLI_PATH = path.join(__dirname, '..', 'bin');
5
6/**
7 * Execute command
8 * @param {String[]} args - args to be passed in
9 * @param {Object} options - customize the behavior
10 *
11 * @returns {Object}
12 */
13const run = (args, options = {}) => spawnSync('node', [CLI_PATH].concat(args), options);
14
15module.exports = run;