Skip to content

bauerca/dynafetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fetch CommonJS modules asyncly; use with dynapack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published