map-cache

WebJar for map-cache

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

map-cache
Last Version

Last Version

0.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

map-cache
WebJar for map-cache
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jonschlinkert/map-cache

Download map-cache

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/map-cache/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>map-cache</artifactId>
    <version>0.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/map-cache/
implementation 'org.webjars.npm:map-cache:0.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/map-cache/
implementation ("org.webjars.npm:map-cache:0.2.2")
'org.webjars.npm:map-cache:jar:0.2.2'
<dependency org="org.webjars.npm" name="map-cache" rev="0.2.2">
  <artifact name="map-cache" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='map-cache', version='0.2.2')
)
libraryDependencies += "org.webjars.npm" % "map-cache" % "0.2.2"
[org.webjars.npm/map-cache "0.2.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

map-cache NPM version NPM downloads Build Status

Basic cache object for storing key-value pairs.

Install

Install with npm:

$ npm install map-cache --save

Based on MapCache in Lo-dash v3.0. MIT License

Usage

var MapCache = require('map-cache');
var mapCache = new MapCache();

API

MapCache

Creates a cache object to store key/value pairs.

Example

var cache = new MapCache();

.set

Adds value to key on the cache.

Params

  • key {String}: The key of the value to cache.
  • value {any}: The value to cache.
  • returns {Object}: Returns the Cache object for chaining.

Example

cache.set('foo', 'bar');

.get

Gets the cached value for key.

Params

  • key {String}: The key of the value to get.
  • returns {any}: Returns the cached value.

Example

cache.get('foo');
//=> 'bar'

.has

Checks if a cached value for key exists.

Params

  • key {String}: The key of the entry to check.
  • returns {Boolean}: Returns true if an entry for key exists, else false.

Example

cache.has('foo');
//=> true

.del

Removes key and its value from the cache.

Params

  • key {String}: The key of the value to remove.
  • returns {Boolean}: Returns true if the entry was removed successfully, else false.

Example

cache.del('foo');

Related projects

You might also be interested in these projects:

Contributing

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

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on May 10, 2016.

Versions

Version
0.2.2