New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@workablehr/idb

Package Overview
Dependencies
Maintainers
13
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workablehr/idb

Request

  • 0.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-55.56%
Maintainers
13
Weekly downloads
 
Created
Source

idb

A simple cache mechanisms that is based on IndexDB.

Installing

Using npm:

$ npm install @workablehr/idb

Basic usage

import makeIDB from "@workablehr/idb";

const idb = makeIDB("workable-store");
idb.get("myKey", { fetch: performFetch, maxAge: 100 });
// if 'myKey' does not exists, it fetches and stores the result for 100 seconds

API

import makeIDB from "@workablehr/idb";
const { store, set, get, clear, del } = makeIDB("workable-store");

All the actions are namespaced by the store name.

set (key, value)

Sets the an entry in the indexed db

get (key, {fetch, maxAge})

Gets a value from the indexed db. If the value does not exists, it calls the fetch function and stores the result for maxAge period.

clear

Clears all the entries that are owned by the workable-store

del (key)

Deletes a specific entry in the index db.

Keywords

FAQs

Package last updated on 04 Mar 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc