No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
index.js
package.json
readme.md

readme.md

async-helmet

Simple exception wrapper for async tasks

build status

Instead of this

function (callback) {

  async.waterfall([

    function (callback) {
      try {

        fs.readdir('../', callback);
      } catch (err) {
        callback(err);
      }
    },

    function (files, callback) {
      try {

        async.map(files, fs.stat, callback);
      } catch (err) {
        callback(err);
      }
    }
  ], callback);
}

do this

function (callback) {

  async.waterfall([

    helmet(function (callback) {
      fs.readdir('../', callback);
    }),
    helmet(function (files, callback) {
      async.map(files, fs.stat, callback);
    })
  ], callback);
}