sub-cache

0.1.2 • Public • Published

sub-cache NPM version

Create namespaced sub caches for transform caches.

Install

Install with npm

npm i sub-cache --save

Run tests

npm test

Usage

var SubCache = require('sub-cache');

API

Create a namespaced sub cache when given a transform-cache instance

  • cache {Object}: Instance of a [transform-cache].
  • namespace {String}: Namespace to use
var Cache = require('transform-cache');
var SubCache = require('sub-cache');
var cache = new Cache();
var subA = new SubCache(cache, 'a');
var subB = new SubCache(cache, 'b');

subA.set('foo', 'bar');
//=> cache.a.foo: 'bar'

subB.set('foo', 'baz');
//=> cache.b.foo: 'baz'

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Brian Woodward

License

Copyright (c) 2015 Brian Woodward
Released under the MIT license


This file was generated by verb on February 03, 2015.

[transform-cache][https://github.com/doowb/transform-cache/]

Readme

Keywords

none

Package Sidebar

Install

npm i sub-cache

Weekly Downloads

0

Version

0.1.2

License

MIT

Last publish

Collaborators

  • doowb