Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alanclarke/micro-amd
A tiny amd lib
https://github.com/alanclarke/micro-amd
ceh cmh implement
Last synced: 3 months ago
JSON representation
A tiny amd lib
- Host: GitHub
- URL: https://github.com/alanclarke/micro-amd
- Owner: alanclarke
- Created: 2016-05-03T21:08:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-11T00:03:35.000Z (over 6 years ago)
- Last Synced: 2024-09-16T03:45:23.991Z (4 months ago)
- Topics: ceh, cmh, implement
- Language: JavaScript
- Size: 27.3 KB
- Stars: 6
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Micro AMD
A tiny, reliable amd module resolver for the browser
## usage
```js
var amd = require('micro-amd')
var api = amd({ base: 'http://example.com' })// module definition
amd.define('noop', [], function callback () {
return function noop () {}
})// synchronous require
var noop = require('noop')
// noop()// asynchronous require
amd.require(['noop'], function callback (noop) {
// noop()
})// require util, submodules
amd.require(['require', 'module-a/lib/helper'], function callback (require) {
var helper = require('module-a/lib/helper')
})//anonymous defines
// anon.js
amd.define(function () {
return 'boop'
})// consumer
amd.require('anon', function (anon) {
console.log(anon) // boop
})// common.js
amd.define(['require', 'module', 'exports'], function (require, module, exports) {
module.exports = 'cjs'
})
```## run tests
```js
npm test
```## Want to work on this for your day job?
This project was created by the Engineering team at Qubit. As we use open source libraries, we make our projects public where possible.
We’re currently looking to grow our team, so if you’re a JavaScript engineer and keen on ES2016 React+Redux applications and Node micro services, why not get in touch? Work with like minded engineers in an environment that has fantastic perks, including an annual ski trip, yoga, a competitive foosball league, and copious amounts of yogurt.
Find more details on our Engineering site. Don’t have an up to date CV? Just link us your Github profile! Better yet, send us a pull request that improves this project.`
Contact GitHub API Training Shop Blog About