0.7.0 • Published 5 months ago

do v0.7.0

Weekly downloads
91
License
MIT
Repository
github
Last release
5 months ago

"do" is the simplest way to manage asynchronicity

CI Status NPM Version NPM Downloads/Month NPM Downloads

If you don't want to use all the async/chain libraries but just want a reliable way to know when the function is done - this is for you.

Installation

npm i do

Usage

Series async execution

const chain = require('do');

const c1 = chain
  .do(readConfig, 'myConfig')
  .do(selectFromDb, 'select * from cities')
  .do(getHttpPage, 'http://kpi.ua')
  .do(readFile, 'README.md');

c1((err, result) => {
  console.log('done');
  if (err) console.log(err);
  else console.dir({ result });
});

Data collector

const chain = require('do');
const fs = require('fs');

const dc = chain.do(6);

dc('user', null, { name: 'Marcus Aurelius' });
fs.readFile('HISTORY.md', (err, data) => dc.collect('history', err, data));
fs.readFile('README.md', dc.callback('readme'));
fs.readFile('README.md', dc('readme'));
dc.take('readme', fs.readFile, 'README.md');
setTimeout(() => dc.pick('timer', { date: new Date() }), 1000);

Run tests

npm test

License & Contributors

Copyright (c) 2013-2023 do contributors. See github for full contributors list. Do is MIT licensed.

0.7.0

5 months ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.16

3 years ago

0.5.15

4 years ago

0.5.14

4 years ago

0.5.13

4 years ago

0.5.12

4 years ago

0.5.11

4 years ago

0.5.10

4 years ago

0.5.9

5 years ago

0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago