šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

idbcache

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idbcache

A lscache like api which is based on indexedDB.

0.3.1
latest
Source
npm
Version published
Weekly downloads
239
71.94%
Maintainers
1
Weekly downloads
Ā 
Created
Source

idbcache

This is a module which tries to mimic lscache api, but with indexedDB storage.

Usage

1.) Install the package npm install idbcache

2.) import it in your file.

import idbcache from 'idbcache' OR,

var idbcache = require('idbcache').default

Available API's are -

1.) Ā  set(key, val, time)

Set a value with name 'key' and value 'val' for 'time' minutes.

eg.

idbcache.set('hello', 'world', 2);

This will set the key 'hello' with value 'world' for 2mins.

2.) Ā  get(key)

Can be used to retrieve a value store against a particular key.

eg.

idbcache.get('hello').then(val => console.log(val));

// logs: "world"

Returns:

A promise.

3.) Ā  remove(key)

Can be used to delete a particular key.

eg.

idbcache.remove('hello');

// deletes: Key titled hello from DB.

5.) Ā  flush()

Can be used to flush the entire key-value store.

eg.

idbcache.flush();

Keywords

indexdb

FAQs

Package last updated on 06 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts