module-export.
Deprecating, please use my new package instead,node-xport
Using node-xport v0.2.0 or later
Using node-xport v0.1.1 or earlier
v0.2.0+ Reference Top
node-xport v0.2.0+ supports two different types of module export, partial exports and full/combined exports. Full/combined exports are done by exporting some object and then making partial exports afterwards, as you can see below. If you do a full export after making partial exports, it will wipe out the partial exports.
Note: v0.2.x is backwards compatible with v0.1.1 and earlier.
DEVELOPERS: Tests can be run from the command line by executing npm test
. No output indicates everything passed (or node secretly hates you).
Examples
- Class exports (Full)
- Function exports (Full)
- Object exports (Full)
- Partial exports (Partial)
- Combined exports
Class export Examples Top
var xport = module; var classExport = { { thisname = name || "DefaultName"; } MyClassprototype { return "Hello my name is " + thisname; }; MyClass { return myInstance; }; return MyClass;}; ;
Function export Examples Top
var xport = module; var { return "A string: '" + str + "' and a number: '" + num + "'.";}; ;
Object export Examples Top
var xport = module; var objectExport = 'somenumber': 99 'somestring': "a string" 'someobject': 'myname': "An Object" ; ;
Partial export Examples Top
var xport = module; var { return "I am another partial export";}; ;;;;
Combined export Examples Top
var xport = module; var combined = { {} Combined { return "Something? :D" }; return Combined;}; ; var { return "I am another partial export";}; ;;;;
Example for v0.1.1 and earlier Top
var xport = ; var myExports = {}; ;