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

bun-migrate

v1.0.6

Published

Based loosely on [postgres-migrations](https://www.npmjs.com/package/postgres-migrations) but instead of requiring pg postgres client it simply uses the bun.sh built in client. You can setup environment variables or pass in a connectionString manually. So

Downloads

110

Readme

bun-migrate

Based loosely on postgres-migrations but instead of requiring pg postgres client it simply uses the bun.sh built in client. You can setup environment variables or pass in a connectionString manually. So for example DATABASE_URL="postgres://user:pw@localhost:5432/database" bunx bun-migrate up.

Follows postgres-migrations simple but powerful ideas:

  1. No rollback. Simply roll forward! In production this is a safer more streamlined approach when compared with always developing a working rollback when its basically never used.
  2. Migrations are sequenced by a simple integer id at the start of the migration's file name. Id's can't be skipped or repeated. Highlights the pitfalls of using time stamps when merging different branches.
  3. A transaction is created for each migration if you are creating indexes that can't be run in a transaction you can turn them off. By including -- postgres-migrations disable-transaction at the top of the file.
  4. Using a file hash to ensure that migrations aren't updated. In development you can simply delete the row from the migration table to run again.
  5. Concurrency, using postgres advisory locks id 765432 to ensure only one client is running migrations while other clients will block waiting before terminating once migrations are complete.

Options

Migrate (up) takes three options:

  • migrationDir Defaults to "migrations" its the directory where you want to store your migration files.
  • includes Glob pattern defaults to "*/.sql" this searches for migration files inside your migration directory.
  • connectionString Falls back to using your environment variables but if set will be used instead.

In action: bunx bun-migrate up --migrationDir=test-migrations --connectionString="postgres://user:pw@localhost:5432/database"

Limitations

This is a very basic implementation atm. There are probably a ton of things that haven't been considered. Short list of things that would be nice to have in the future:

  1. Javascript migrations.. postgres-migrations allows for executing javascript atm I haven't implemented this.. although it would be nice. ATM each migration must be .sql.
  2. Supporting mysql as well wouldn't be much work and might be nice.