helpers.js 400 B

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