simplecache@1.0.0

simplecache@1.0.0

Simple memory cache.

By @mantradev

Install with:

$ mantrad download-component simplecache@1.0.0

Or install last version with:

$ mantrad download-component simplecache

README.md

simplecache Mantra component

This component exposes implements a simple memory cache for key / value pairs.

The component defines a simple API with the following properties exposed at Mantra.api.simplecache.

API exposed by simplecache

Mantra.api.simplecache.Add( key, value )

Adds a new value giving its key. If the value already exists, then it is replaced.

Parameters:

  • key: string indicating the key of the value to add
  • value: any kind of data (simple type or object) to cache for that key

Mantra.api.simplecache.Get( key )

Get a value given its key.

Parameters:

  • key: string indicating the key of the value to get

Mantra.api.simplecache.Exists(key)

Returns true or false if the value indicated as parameter exists or no.

Parameters:

  • key: string indicating the key of the value to check