0.2.0 • Published 11 years ago
modula v0.2.0
Modula.js
Modula is dead simple library which helps with modular testing. I was needed it for Node.js's require replacement to use with Karma test runner.
Usage
Define module:
# ... if modula? modula.export('lisn', Lisn) else if module? module.exports = Lisn else window.Lisn = Lisn
Use it in specs:
Lisn = require('lisn') # ...
That's it!
Installation
modula
avaliable as npm and bower json.
API
modula
modula
is a global namespace.
modula.export(name, exports)
Saves exports
associated with passed module name
.
modula.export('backbone', Backbone)
modula.require(name)
Returns module associated with name
. Also avaliable as window.require
.
Backbone = require('backbone')