dirty-store

A quick and dirty, nestable store that converts well to a native JS object.

dirty-store

A quick and dirty, nestable store that converts well to a native JS object. Won't store objects.

var store = require('./');
 
var person = Object.create(store).init({ name: 'tom' });
 
person.set('name', 'dave');
person.set({
  age: 24,
  skill: 'javascript'
});
 
person.inc('age');
 
person.add('computer').set('model', 'macbook');
person.for('computer').set('color', 'silver');
 
var dog = person.for('dog').set({
  name: 'rufus',
  breed: 'daschund',
  age: 10
});
 
dog.dec('age');
 
var personObj = person.toObject();
 
console.log(require('util').inspect(personObj, { depth: null, colors: true }));

Set the store up with an initial state.

Chainable.

Set the value at a particular key.

Chainable.

Set via an object.

Chainable.

Get value at key

Increment value at key

Chainable.

Decrement value at key

Chainable.

Add nested store at key

Chainable (returns new store).

Add and/or retrieve nested store at key.

Return simple JS object with stored data

With npm:

$ npm test

MIT