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

surrealkit

v0.0.1

Published

A CLI tool for managing SurrealDB migrations and backups

Readme

Surreal Kit

A CLI tool for managing SurrealDB migrations

[!IMPORTANT]
Minimum SurrealDB version: 2.0.0

Command overview

[!NOTE] When using the CLI you can use the command surrealkit, or the abbreviated alias surkit (sounds like circuit)

Create a new schema migration

surkit diff <migration-name>

surrealkit will generate a new migration file by diffing your schema files and your migration files to determine what changes need to be made.

Create a new data migration

surkit new <migration-name>

surrealkit will generate a blank migration file for you to fill in with a manual data migration.

Run migrations

surkit migrate

surrealkit will run all migrations in the migrations directory.

Project structure

surrealkit stores its data in the surreal directory, with migrations and schema subdirectories. If the directories don't exist, the CLI will create them for you automatically when you run it.

The data subdirectory is reserved for your use during local development in case you want to keep your data with the rest of your surrealkit files. i.e. you could set the SURREAL_PATH env variable to surrealkv://surreal/data. Just remember to add /surreal/data to your .gitignore.

.
└── surreal/
    ├── data (optional)
    ├── migrations
    └── schema

For now, it is recommended that you don't add any additional subdirectories to surreal to avoid conflicts with backup/snapshot directories that may exist in the future.

Environment variables

surrealkit makes use of some of SurrealDB's environment variables in order to connect to your database to run migrations. For surrealkit to work properly, you will need to set the following environment variables:

# .env
SURREAL_NAMESPACE=...
SURREAL_DATABASE=...
SURREAL_USER=...
SURREAL_PASS=...
SURREALKIT_ENDPOINT=...

The first four are SurrealDB variables which will also work with regular Surreal CLI commands like surreal start or surreal sql. SurrealDB doesn't have an env variable dedicated to the endpoint, so surrealkit uses SURREALKIT_ENDPOINT for that purpose.

During local development, you may want to set the SURREAL_BIND variable, which is used by the surreal start command, and use it to set the SURREALKIT_ENDPOINT variable.

SURREAL_BIND=127.0.0.1:5050
SURREALKIT_ENDPOINT=http://${SURREAL_BIND}

Unsupported features

At the moment, surrealkit only supports a single database per project.

The diff command uses the INFO FOR ... commands to get the current state of the database. The following info keys are not currently supported:

  • users at any level, to avoid committing passwords to version control.
  • accesses at the root and namespace level, since only a single database is supported per project.
  • models (INFO FOR DB), because they are not created using the DEFINE statement.
  • lives (INFO FOR TABLE), because they are not created using the DEFINE statement.
  • tables (INFO FOR TABLE), because those are managed by SurrealDB