UNPKG

coffee

Version:
39 lines (34 loc) 891 B
'use strict'; var Coffee = require('./lib/coffee'); exports.Coffee = Coffee; /** * fork a child process to test * @param {String} modulePath - The module to run in the child * @param {Array} args - List of string arguments * @param {Object} opt - fork options * @see https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options * @return {Coffee} coffee instance */ exports.fork = function(modulePath, args, opt) { return new Coffee({ method: 'fork', cmd: modulePath, args, opt, }); }; /** * spawn a child process to test * @param {String} cmd - The command to run * @param {Array} args - List of string arguments * @param {Object} opt - spawn options * @return {Coffee} coffee instance */ exports.spawn = function(cmd, args, opt) { return new Coffee({ method: 'spawn', cmd, args, opt, }); };