parallel-await
v0.1.0
Published
Create HTML text from JS object
Downloads
2
Readme
parallel-await
typed parallel await of any object
Install
$ npm install parallel-await
API
parallel(promiseObject):resolvedObject
import {parallel} from 'parallel-await';
var threeTasks = {
data: db.query('SELECT client FROM clientes LIMIT 1'),
content: fs.promises.readFile('template.html'),
outFh: fs.promises.open('first-client.html','w')
}
var {data, content, outFh} = await parallel(threeTasks);
var mergedContent = await applyTemplate(content, data);
await outFh.write(mergedContent);
await outFh.close();
await parallel
awaits the parallel execution launched in threeTasks
variable.