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

@alancnet/psqlite

v1.0.0

Published

Interactive sqlite3-style shell for PGlite (PostgreSQL in WASM)

Downloads

79

Readme

psqlite

Interactive command-line shell for PGlite—PostgreSQL compiled to WebAssembly—with a sqlite3-shaped interface: flags, one-shot SQL, piping, and dot commands.

Install

npm install -g @alancnet/psqlite

The psqlite command name is unchanged after install.

Requires Node.js 18+. PGlite is not installed by this package. Install @electric-sql/pglite in your project or globally (npm install -g @electric-sql/pglite). At runtime, psqlite loads PGlite from the nearest package.json directory when walking up from your current working directory, then from the global npm modules folder if needed.

Usage

Same overall shape as sqlite3: optional flags, then FILENAME (the PGlite data directory), then optional SQL to run once. If you omit FILENAME, PSQLITE_DATA_DIR, and -d, psqlite uses the current directory when it looks like an initialized PGlite/PostgreSQL data directory (e.g. it contains PG_VERSION—typical when your shell is cd’d into the cluster).

Start the REPL:

psqlite ./mydb
# or
PSQLITE_DATA_DIR=./data psqlite
# or
psqlite -d ./data

Run SQL and exit:

psqlite ./mydb -e "SELECT version()"
psqlite ./mydb "SELECT 1"

Other common options:

psqlite --help
psqlite -version
psqlite -csv -noheader ./data "SELECT * FROM mytable LIMIT 5"
psqlite -init schema.sql ./data
psqlite --file queries.sql -d ./data
echo "SELECT 1" | psqlite -batch ./mydb

Environment

| Variable | Meaning | |----------|---------| | PSQLITE_DATA_DIR | Database directory when you omit FILENAME on the command line (-d / --data-dir overrides this and FILENAME) |

Dot commands (interactive)

At the pglite> prompt: .tables, .schema, .indexes, .mode, .headers, .pretty, .databases, .quit / .exit / \q.

Developing this repo

This package does not ship @electric-sql/pglite. Install it in this directory (or run the CLI from another project that already depends on PGlite):

npm install
npm install @electric-sql/pglite
node bin/psqlite.js --help

Link globally while hacking:

npm link
psqlite -version

License

MIT