npm.io
0.0.1 • Published 10 years ago

consto

Licence
MIT
Version
0.0.1
Deps
0
Vulns
0
Weekly
0
Stars
1

consto NPM version Build Status Dependency Status Coverage percentage

A way to define an object having the same value to its name attribute string

Consto stands for constant objects.

Installation

$ npm install --save consto

Usage

var consto = require('consto');


//Upper Style, default style
var co = consto(['rain', 'sea', 'key']);

>co.RAIN => 'RAIN'
>co.SEA => 'SEA',
>co.KEY => 'KEY'

//Free Style, by specifiy a true
var fs = consto(['Rain', 'sea', 'KEY'], true);
// > fs
// { Rain: 'Rain', sea: 'sea', KEY: 'KEY' }

License

MIT calidion

Keywords