nspc

1.1.0 • Public • Published

nspc

Build Status NPM Version License

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

Readme

Keywords

Package Sidebar

Install

npm i nspc

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • mohayonao