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

pglite-cipher

v0.1.2

Published

Encryption at rest for PGlite: AES-256-GCM through WebCrypto, blocks in IndexedDB, like SQLCipher for Postgres in the browser.

Readme

pglite-cipher

Encryption at rest for PGlite, the Postgres build that runs in the browser. It works like SQLCipher, with AES-256-GCM through WebCrypto and no runtime dependencies.

  • Encrypts below Postgres. Every file under PGDATA is encrypted, including catalogs, WAL and pg_control. File names, sizes and the file count are hidden.
  • Detects tampering. A changed, moved, replayed or missing block fails the open (CorruptStoreError).
  • Two-tier keys. You supply a key-encryption key, and the package wraps its own data key. You can change the key instantly, or rotate the data key.

Try the demo: in your own browser, compare plain and encrypted speed, search the raw storage for your data, and flip a bit to watch the open refuse it.

Quick start

npm install pglite-cipher @electric-sql/pglite

Or straight from GitHub (it builds on install): npm install github:2002Bishwajeet/pglite-cipher @electric-sql/pglite.

import { PGlite } from '@electric-sql/pglite';
import { EncryptedFs, IndexedDbBackend, importKek } from 'pglite-cipher';

const key = await importKek(rawKey); // 32 random bytes, e.g. from the OS keychain
const fs = new EncryptedFs({ backend: new IndexedDbBackend('data'), key, mode: 'open-or-create' });
const pg = await PGlite.create({ fs, relaxedDurability: true });

await pg.exec('CREATE TABLE IF NOT EXISTS notes (id serial PRIMARY KEY, body text)');
await fs.syncToFs(false); // sync when it matters, e.g. when the page is hidden
await pg.close();

@electric-sql/pglite (^0.5.10) is a peer dependency. You can also use it from source as a git submodule (Usage).

What it does not protect

  • Memory. While the database is open, it is plaintext in the page's memory.
  • A rollback of the whole store to an older full copy. That copy opens.
  • Exports. dumpTar, dumpDataDir() and pg_dump output are plaintext.

See SECURITY.md and the threat model.

Docs

Develop

Requires Node 22 or newer. AGENTS.md has the rules.

npm ci
npx playwright install chromium firefox webkit   # add --with-deps on a fresh Linux machine
npm test                # Node
npm run test:browser    # Chromium, Firefox and WebKit
npm run lint && npm run typecheck

Licence

Apache-2.0, © Bishwajeet Parhi. Versions 0.1.0 and 0.1.1 were released under FSL-1.1-ALv2. Contributions are made under the CLA. Third-party notices are in THIRD_PARTY.md.