UNPKG

dis-dat

Version:

Run commands in parallel (dad / dis-and-dat) or sequentially (dtd / dis-then-dat)

9 lines (8 loc) 467 B
import worker from './worker.js'; export * from './types.js'; export default function disDat(commands, options, callback) { callback = typeof options === 'function' ? options : callback; options = typeof options === 'function' ? {} : options || {}; if (typeof callback === 'function') return worker(commands, options, callback); return new Promise((resolve, reject)=>worker(commands, options, (err, results)=>err ? reject(err) : resolve(results))); }