4 ms·
"If you've ever use Node or Python you've used CommonJS modules" Huh? Python, really?
by exogen 15y ago
"If you've ever use Node or Python you've used CommonJS modules"
Huh? Python, really?
- joeyespo 15y agoI could be wrong, but I imagine he's referring to the module concept. Not CommonJS itself. (Or perhaps referring to skulpt.org, but I doubt that.)
- maccman 15y agoYes, that's correct. Importing is similar to require(), although there's no explicit exporting.
- JonnieCache 15y agoCommonJS modules are modelled on python's I think.
- snprbob86 15y agoWith CoffeeScript's destructuring assignment, you can even simulate Python's "from" clause: foo = require 'foo' {Bar} = require 'bar' {X, f} = require 'abc' Compiles to: var Bar, X, f, foo, _ref; foo = require('foo'); Bar = require('bar').Bar; _ref = require('abc'), X = _ref.X, f = _ref.f;