Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 601 Bytes

README.md

File metadata and controls

41 lines (30 loc) · 601 Bytes

Reqwire

Reqwire is an asynchronous module loader for Node.js.

Usage

// asyncModuleA.js
require('reqwire')(module, function (done) {
  someAsyncInitFunc(function () {

    done();

  });
});

// asyncModuleB.js
require('reqwire')(module, function (done) {
  someAsyncInitFunc(function () {

    done();

  });
});

// main.js
var asyncModuleA = require('./asyncModuleA');
var asyncModuleB = require('./asyncModuleB');

var asyncDependencies = [
  asyncModuleA,
  asyncModuleB
];
require('reqwire')(module, asyncDependencies, function (done) {
  // ...

  done();
});