API Docs for: 0.3.0
Show:

store Module

Defined in: lib/store/tmp.js:18

An abstraction for keeping track of content against some keys (e.g. original source, instrumented source, coverage objects against file names). This class is both the base class as well as a factory for Store implementations.

Usage

 var Store = require('istanbul').Store,
     store = Store.create('memory');

 //basic use
 store.set('foo', 'foo-content');
 var content = store.get('foo');

 //keys and values
 store.keys().forEach(function (key) {
     console.log(key + ':\n' + store.get(key);
 });
 if (store.hasKey('bar') { console.log(store.get('bar'); }


 //syntactic sugar
 store.setObject('foo', { foo: true });
 console.log(store.getObject('foo').foo);

 store.dispose();

This module provides the following classes: