1.1.0 • Published 8 years ago
nspc v1.1.0
nspc
simplest namespace generator
Installation
$ npm install nspc
API
nspc(namespace: string, [ root: object ]): object
Examples
create a nested namespace object
const nspc = require("nspc");
const Collections = nspc("System.Generic.Collections");
const System = nspc("System");
assert.equal(System.Generic.Collections, Collections);
with root object
const nspc = require("nspc");
const target = {};
const Collections = nspc("System.Generic.Collections", target);
assert.deepEqual(target.System.Generic.Collections, {});
global namespace
const nspc = require("nspc/global");
const Collections = nspc("System.Generic.Collections");
assert.deepEqual(global.System.Generic.Collections, {});
License
MIT