- We are writing a digital textbook-reading app.
- Most of the time you have a "basic" license for your textbook, but one (and only one) of your computers can request an "enhanced" license.
- You can only print from the computer with the enhanced license.
| /** | |
| * Registers module as CommonJS or AMD if support is found | |
| * and creates an exports object for the module to use | |
| * | |
| * @param {boolean} cjs | |
| * @param {boolean} amd | |
| * @param {Object} ex | |
| * @return {Object} | |
| */ | |
| var exports = (function(cjs, amd, ex){ |
| Apache License | |
| Version 2.0, January 2004 | |
| http://www.apache.org/licenses/ | |
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
| 1. Definitions. | |
| "License" shall mean the terms and conditions for use, reproduction, |
| // Named constants with unique integer values | |
| var C = {}; | |
| // Tokenizer States | |
| var START = C.START = 0x11; | |
| var TRUE1 = C.TRUE1 = 0x21; | |
| var TRUE2 = C.TRUE2 = 0x22; | |
| var TRUE3 = C.TRUE3 = 0x23; | |
| var FALSE1 = C.FALSE1 = 0x31; | |
| var FALSE2 = C.FALSE2 = 0x32; | |
| var FALSE3 = C.FALSE3 = 0x33; |
In both cases below, ID is the exports object of the "id" module.
require.ensure(["id"], function (require) {
var ID = require("id");
})Just want to chime in that I'm glad people are still interested in CommonJS Modules/2.0. We have a working implementation that hopefully will be of interest, and have factored out the generally applicable parts of our test suite. Also see the announcement thread on the CommonJS list.
That said, personally I've been a bit disappointed with the CommonJS community's lack of enthusiasm on Modules/2.0. We picked it up early in our project lifecycle, and ran with it full speed. At the time it seemed like a more standardized alternative to AMD.
However, over time it's become clear that AMD has not only won mindshare but also has a much more active group of maintainers and a better, more egalitarian standards process. Whereas, Modules/2.0 has only the perennially busy Wes Garland, leaving a self-hosted PDF s
| var polyglot = require('polyglot'); | |
| polyglot.register('coffee', require('coffee-script').CoffeeScript.compile); | |
| polyglot.require('math').square(2); |
| twttr.secrets.html5Routing = true; | |
| twttr.router._changeUrlAndCallAction = function(p) { | |
| return twttr.Router.prototype._changeUrlAndCallAction.call(this, p.replace("#!/", "")); | |
| } | |
| twttr.router._changeUrlAndCallAction(window.location.hash); |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!