Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pocketsmith/nativescript-cache

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

var cache = require("nativescript-cache");

cache.set("key1", "val1");
cache.get("key1"); // "val1"

cache.delete("key1");
cache.get("key1"); // undefined

cache.set("key2", "val2");
cache.set("key3", "val3");
cache.clear();
cache.get("key3"); // undefined

About

A persistent caching plugin for NativeScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.