dynafetch

0.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i dynafetch

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • bauerca