jocal

0.0.2 • Public • Published

jocal

npm install jocal

does this.

var jocal = require('jocal');
var MY_KEY = 'super-sweet-obj-that-i-must-have-for-later';
var obj = {
    hey: 'everyone'
};
 
jocal(MY_KEY, obj);

then later do this

var jocal = require('jocal');
var MY_KEY = 'super-sweet-obj-that-i-must-have-for-later';
 
var obj = jocal(MY_KEY);
 
alert(obj.hey); // alerts 'everyone'

then even later still you can delete it

var jocal = require('jocal');
var MY_KEY = 'super-sweet-obj-that-i-must-have-for-later';
 
jocal(MY_KEY, null);

pro usage

var jocal = require('jocal'),
    myFlag = jocal.bind(null, 'myFlagKey');
 
myFlag(true);
console.log(myFlag() ? 'print this' : 'not this');

Package Sidebar

Install

npm i jocal

Weekly Downloads

139

Version

0.0.2

License

ISC

Last publish

Collaborators

  • chevett