npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

persistent-store

v0.0.4

Published

Simplify how to use IndexedDB

Readme

persistent-store

Simplify how to use IndexedDB

This library uses the IndexedDB library under the hood and makes it easy to use.

Installation

npm install persistent-store --save
yarn add persistent-store

Boot Options

In the PersistentStore class there is a static crateStore method that must be called before any interaction with the database. This method will initialize the bank with the settings you enter.

import PersistentStore from 'persistent-store'

// `db_name` string containing the database name
// `db_version` integer containing the version of the database
// `db_collections` list containing all database collections and their settings
PersistentStore.crateStore('project', 1, [
  // db_collections

  // `collection_name` string containing the collection name
  // `collection_key` string containing the key to access each object in the collection
  // `collection_increment` boolean containing the rule for auto increment. In true case the bank itself will add a value to the object's key
  { name: 'users', key: 'index', increment: true },
  ...
])

PersistentStore API

Request methods allowed.

  • store.count(collection): Promise
  • store.clear(collection): Promise
  • store.get(collection, key): Promise
  • store.getAll(collection): Promise<T[]>
  • store.getAllKeys(collection): Promise<(string | number)[]>
  • store.add(collection, value): Promise<string | number>
  • store.addMany(collection, data): Promise<(string | number)[]>
  • store.update(collection, value): Promise
  • store.updateMany(collection, data): Promise
  • store.delete(collection, key): Promise
  • store.deleteMany(collection, keys): Promise

Example of Use

import PersistentStore from 'persistent-store'

const store = new PersistentStore('project')

const users = await store.getAll('users')
...

Credits

License

MIT