Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including do with all npm packages installed. Try it out:

var _do = require("do")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

do v0.5.14

The simplest way to manage asynchronicity

"do" is the simplest way to manage asynchronicity

CI Status Badge 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.


npm i do


Series async execution

const chain = require('do');

const c1 = chain
  .do(readConfig, 'myConfig')
  .do(selectFromDb, 'select * from cities')
  .do(getHttpPage, '')
  .do(readFile, '');

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

Data collector

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

const dc =;

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

Run tests

npm test




RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free