Skip to content

Repository files navigation

nativescript-cache

Note: this plugin is not being actively maintained.

nativescript-cache is a persistent caching plugin for NativeScript. Use it to store arbitrary data locally for fast access.

Built atop TMCache on iOS, and SharedPreferences on Android.

Installation

tns plugin add nativescript-cache

Usage

The cache plugin supports the following methods:

  • get(key)
  • set(key, value)
  • delete(key)
  • clear

Note that the value of the cache entry must be a string. If you want to store complex data, use JSON.stringify before putting the data in the cache, and JSON.parse on the way out.

varcache=require("nativescript-cache");cache.set("key1","val1");cache.get("key1");// "val1"cache.delete("key1");cache.get("key1");// undefinedcache.set("key2","val2");cache.set("key3","val3");cache.clear();cache.get("key3");// undefined

About

A persistent caching plugin for NativeScript

Resources

Stars

4 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages