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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sqlitedump

v1.1.0

Published

SQLite is great but it does fall short when dealing with an evolving schema.

Downloads

11

Readme

Bun script to dump the data of your SQLite database

SQLite is great but it does fall short when dealing with an evolving schema.

Assuming you keep your schema in a text file as CREATE TABLE and CREATE INDEX statements, I had planned on just dumping out the data, blowing away and recreating the database, and importing the data back.

You can dump with .dump --data-only --nosys but that doesn't include column names, so no problem, I figured I'd just append columns and never rearrange them. Turns out even that doesn't work -- the INSERT statements fail due to column length mismatch, even if the new columns are nullable.

So then you go to stackoverflow and see a 14 year old question with some awk or perl code you can paste in. Who can even read awk code? No thanks.

So here is a JS utility to be run with bun that dumps out all your data including column names. Run it with:

bunx sqlitedump mydb.sqlite

Note: Bun's SQLite adapter doesn't seem to distinquish between NULL and empty string. Any NULL text fields will be upgraded to empty string.

Alternatives considered: ActiveRecord from Ruby on Rails talks to SQLite databases, maybe you could use just the migration features without the MVC stuff. Seems like overkill though.

Currently this lets you rearrange columns and add new columns. In future this library may be extended to handle column renaming and column deletion.

New in version 1.1: Columns that match the default are omitted. This means if you clear out all the data for a column, you can go ahead and remove it from your schema.

This requires bun because it's dependency-free and leverages the SQLite features of the bun standard library.