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

idb-easier

v1.3.1

Published

indexedDB storage: Make using 'idb' even easier!

Readme

idb-easier

Overview

idb-easier is a simple wrapper for idb -- which is itself a wrapper for making indexedDB more usable.

Installation

npm i idb-easier

OR

bun i idb-easier

Usage

my-ui-component.ts

import {
  IdbConfig,
  idbConnectDatabase as useDB,
  idbDeleteDatabase,
  idbGet,
  idbSet
} from 'idb-easier'

// ---------------------------
// Define indexedDB Parameters
// ---------------------------
const IDB_CONFIG = Object.freeze({
  dbName: 'myDatabase',
  storeName: 'myStore',

  // OPTIONAL key
  //
  // indexConfig is an optional config key.
  // It is used if you use an index.
  //
  // Refer to indexedDB documentation for more details.
  indexConfig: {
    indexName: 'timestamp',
    keyPath: 'id',
    autoIncrement: true,
  },
})

// The `db` object is returned to optionally give the developer
// direct access to `idb` package's db methods not included/wrapped
// in the this `idb-easier` package.
const db = await useDB(IDB_CONFIG: IdbConfig).catch((err) => {
  console.trace(err.message)
})

await idbSet(myData, 'my-key')

const data = await idbGet('my-key')

Delete Database

// Pass in dbName and catch error if delete fails.
await idbDeleteDatabase(IDB_CONFIG.dbName).catch((err) => {
  console.trace(err.message)
})

// If delete has no errors, db no longer exists. idbConnectDatabase()
// must be called again to use the idbSet() and idbGet() methods.

Delete a Record in the Store

await idbDeleteRecord(IDB_CONFIG.storeName, 'my-key')

Get All Records Filtered By Key Prefix

Retrieve all records in which the DB keys match the prefix string.

Limitations

  • prefix only, no suffix matching

  • matching is case sensitive

// The database's keys have country code prefixes:
//
//   'jp:companyZ'
//   'sg:companyA'
//   'tw:companyL'
//   'sg:companyB'
//   'sg:companyC'
const singaporeanItems = await idbGetAllPrefixFilter(IDB_CONFIG.storeName, 'sg:')

singaporeanItems is an array of 3 items that match the 'sg:' prefix argument.

(Using this colon delimited key format is the same as you'd use in valkey/redis.)

Have fun!

Credits

Gerry Gold

January 2026