encrypt-async-cache
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published



async-encrypted-disk-cache

An encrypted async disk caching module

Coverage Status

Install

$ npm install encrypt-async-cache

Usage

const FileSystemCache = require("encrypt-async-cache").FileSystemCache;

Example


const myCache = new FileSystemCache("my-cache", "my-secret-key");

myCache.set("firstCache", "This is the data").then(success => {
  success === true;
  // item is put into cache
});


myCache.get("firstCache").then(cachedItem => {
  cachedItem === "This is the data";
  // item is retrieved from the cache
});


myCache.remove("firstCache").then(hasRemoved => {
  hasRemoved === true;
  // item is removed from the cache directory
});

myCache.clear().then(hasCleared => {
  hasCleared === true;
  // your cache directory has been cleared
});

Readme

Keywords

none

Package Sidebar

Install

npm i encrypt-async-cache

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

250 kB

Total Files

45

Last publish

Collaborators

  • lukegarrigan