Name: fetchamd
Owner: ABC News
Description: A lightweight, mostly AMD module loader.
Created: 2015-04-27 06:14:38.0
Updated: 2018-01-22 21:51:29.0
Pushed: 2015-05-12 05:50:24.0
Homepage: null
Size: 174
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A lightweight AMD module loader for the client-side.
Have you ever wanted to load up a library programmatically, like Underscore, D3, or something you've written yourself and felt it's just out of your grasp? Enter fetchamd, your dead simple AMD loader.
load = require('fetchamd');
([
'http://example.org/module1.js',
'/res/modules/module2.js'
unction(module1, module2){
// module1 and module2 are ready to use.
This library is not intended as a replacement for RequireJS or other fully featured module loaders. This library doesn't implement the full AMD spec for recursive module loading or relative name resolution. Thus, it is intended as a loader for discrete pre-compiled modules (such as those compiled with Browserify) rather than full trees of AMD dependencies.
Requirements:
To keep the filesize down, this library requires jQuery's $.ajax
and
$.extend
methods. For older versions of IE, jQuery's ajax method is used
rather than native HTML methods for compatibility.
Browser support:
This library is working on all modern browsers and has been tested in IE versions 7 through 11.
AMD Support:
Fetchamd can presently do the following:
Differences from AMD spec:
Tests for this module are written in Mocha + Chai & require a web server (such as Python's SimpleHTTPServer). To test this module:
npm install
to make sure you have all the dependencies.npm run server
to start a web server (this step requires Python, but you
can run this from your own web server if you'd prefer).http://0.0.0.0:8000/test/
in your browser to run the tests.