Skip to content
soliton4 edited this page Dec 6, 2014 · 8 revisions

Modules

Stability: 3 - Stable

required

  • *promise

promiseLand assumes that a module loader is in use. promiseLand modules are compatible with commonjs as well as AMD style loaders.

simply use return in the main scope to define the export of the module.

    // content of somefile.pland
    var private = "some private module variable"
    
    // the export:
    return {
      gimme: function(){
        return private;
      }
    };
    
    // execution ends at return (ofc)
    // just want to be thorough - sorry for being boring
    code.that.is.never.executed();

a compatibility subset for usage without a module loader exists, but it is uncertain at this point if it will be continued.

require

require is a keyword in promiseLand.
require expression

Magic

if a pro

Clone this wiki locally