abcnews/fetchamd

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

fetchamd

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.

Features/support

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:

Development

Tests for this module are written in Mocha + Chai & require a web server (such as Python's SimpleHTTPServer). To test this module:

  1. npm install to make sure you have all the dependencies.
  2. 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).
  3. Open http://0.0.0.0:8000/test/ in your browser to run the tests.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.