Package Exports
- map-cache
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (map-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
map-cache

Basic cache object for storing key-value pairs.
Based on MapCache in Lo-dash v3.0.
Install with npm
npm i map-cache --save
Usage
var mapCache = require('map-cache');
API
MapCache
Creates a cache object to store key/value pairs.
var cache = new MapCache();
.set
Adds value
to key
on the cache.
key
{String}: The key of the value to cache.value
{*}: The value to cache.returns
{Object}: Returns theCache
object for chaining.
cache.set('foo', 'bar');
.get
Gets the cached value for key
.
key
{String}: The key of the value to get.returns
{*}: Returns the cached value.
cache.get('foo');
//=> 'bar'
.has
Checks if a cached value for key
exists.
key
{String}: The key of the entry to check.returns
{Boolean}: Returnstrue
if an entry forkey
exists, elsefalse
.
cache.has('foo');
//=> true
.delete
Removes key
and its value from the cache.
key
{String}: The key of the value to remove.returns
{Boolean}: Returnstrue
if the entry was removed successfully, elsefalse
.
cache.delete('foo');
Run tests
Install dev dependencies.
npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright (c) 2015 Jon Schlinkert
Based on MapCache in Lo-dash v3.0. MIT License
Released under the MIT license
This file was generated by verb-cli on March 18, 2015.