
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
A key-value store which supports expiration time based on IndexedDB.
Powered by idb-keyval.
Install dependencies,
$ npm i ttl-db --save
All APIs return a promise because all of them is asynchronous operation.
set:Set value by key, support expiration time.
import { set } from 'ttl-db';
set(key, value); // won't expire
// or
set(key, value, { ttl: 60 }); // expires after 60 seconds
get:Get value by key.
import { get } from 'ttl-db';
get(key);
setMany:Set batch of key-value parallelly for speed up, support expiration time.
import { setMany } from 'ttl-db';
setMany([
[key1, value1], // won't expire
[key2, value2, { ttl: 60 }], // expires after 60 seconds
]);
getMany:Get batch of value parallelly for speed up.
import { getMany } from 'ttl-db';
get([key1, key2]);
update:Update value of key.
import { update } from 'ttl-db';
update(key, (oldValue) => oldValue + 1); // won't expire
// or
update(key, (oldValue) => oldValue + 1, { ttl: 60 }); // expires after 60 seconds
del:Delete key.
import { del } from 'ttl-db';
del(key);
delMany:Delete keys.
import { delMany } from 'ttl-db';
delMany([key1, key2]);
clear:Clear entire store.
import { clear } from 'ttl-db';
clear();
FAQs
A key-value store which supports expiration time based on IndexedDB.
We found that ttl-db demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.