0.0.3 • Published 10 years ago

dynafetch v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Dynafetch

Dynafetch is a simple library that loads CommonJS modules "asynchronously" in Node and asynchronously in the browser.

It is meant to be used with dynapack.

Example

var fetch = require('dynafetch')(require);
fetch(['superagent', 'underscore'], function(request, _) {
    // Do the coolest things.
});

Details

In Node, dynafetch just wraps up a series of require calls inside a process.nextTick callback.

In the browser, dynafetch assumes an enhanced require function that takes a callback as a second parameter. The callback receives the loaded module as its sole argument. The details of how that module is loaded are up to the implementer of the require function that is passed to dynafetch.

License

MIT