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

ngrate

v1.0.0-rc2

Published

A simple and database agnostic migrations system

Readme

ngrate Build Status

NPM

This is a ultra simple, database agnostic, migrations library based on ES6 Promises.

npm install ngrate --save

Creating a new migration

To create a new migration simply run

ngrate create migration-name

This will generate a file under 'migrations/' folder with the timestamp and the name.

The file will look like the this code below:

const name = 'create-user-table';
const createdAt = 1476651301760;

exports.createdAt = createdAt;
exports.name = name;

exports.up = () => {
    return new Promise((resolve, reject) => {
        //TODO: Write migration code
        resolve();
    });
};

exports.down = () => {
    return new Promise((resolve, reject) => {
        //TODO: Write migration code
        resolve();
    });
};

From this, you should require the databases you need and do your operation.

Running specific migrations

You can run a specific migration by using the command up or down.

ngrate up migrations/yourmigrationfile.js

ngrate down migrations/yourmigrationfile.js

Execute pending migrations

To run pending migrations just type

ngrate run

This will get the last migration execution and run the next one forward. Running one by one until all succeed or one fails.

In case one migration fails, the state left will be up to the latest successful migration

Strategies

ngrate is based on migration strategies which is a interface that can be found here

You can write your own strategy by implementing those methods. By default, this library comes with a local file strategy.

Customizing strategy

You can customize your strategy by creating a file called .ngrate.js

This file should look like this

module.exports = {
    migrationsDir: 'migrations',
    strategy: require('./strategies/local-strategy')
};

Where strategy is a new instance of your AbstractStrategy implementation.

Available Strategies

I'm going to write new strategies for the following databases:

  1. MongoDB
  2. Redis

If you have any suggestion, just create an issue.

Strategies should not exist within this code base. The implementations should exist as separate modules.