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

pg-seed-kit

v0.0.1

Published

A lightweight, zero-dependency seeder toolkit for Postgres that works with Prisma, Drizzle, TypeORM, and Sequelize.

Readme

pg-seed-kit

npm version license downloads GitHub Stars

A lightweight, zero-dependency seeder toolkit for Postgres that works with Prisma, Drizzle, TypeORM, and Sequelize. Run one-time seed scripts on startup, track execution status, and manage seeders via a small CLI.

The package ships no runtime dependencies: instead of opening its own connection, it runs its tracking SQL through a tiny adapter built on the connection your ORM already owns.

Docs with copy-paste examples for every ORM: https://kulcsarrudolf.github.io/pg-seed-kit/

Installation

npm install pg-seed-kit

Your ORM is an optional peer dependency: install whichever one you already use (@prisma/client, drizzle-orm, typeorm, or sequelize).

Quick Start (Drizzle)

Point pg-seed-kit at your seeders and tell it how to connect. Create pg-seed-kit.config.js:

import { drizzleAdapter } from "pg-seed-kit/drizzle";
import { db, pool } from "./db.js"; // your drizzle db + pg Pool

export default {
  seedersPath: "./src/db/seeders",
  connect: async () => drizzleAdapter(db, { close: () => pool.end() }),
};

Scaffold a seeder:

npx pg-seed-kit create add-admin

Implement the generated src/db/seeders/20260320120000-add-admin.seeder.ts:

import { db } from "../../db.js";
import { users } from "../schema.js";

const seed = async (): Promise<void> => {
  await db
    .insert(users)
    .values({ email: "[email protected]", role: "admin" })
    .onConflictDoNothing();
};

export default seed;

Run pending seeders, either from your app (after the ORM is connected) or via the CLI:

import { runPendingSeeders } from "pg-seed-kit";
import { drizzleAdapter } from "pg-seed-kit/drizzle";
import { db } from "./db.js";

await runPendingSeeders({ adapter: drizzleAdapter(db) });
npx pg-seed-kit run

Using Prisma, TypeORM, or Sequelize? The same three steps, with that ORM's adapter and idiom: see the website.

How It Works

  1. Seeder files are sorted alphabetically; the timestamp prefix (20260320120000-) keeps them in chronological order.
  2. On each run, only seeders without a success record in the tracking table are executed. The table (seeders by default) is auto-created on first run.
  3. If a seeder fails it is recorded as failed and retried on the next run; execution continues with the remaining seeders.

API

All functions take an options object with a live adapter and assume your ORM is already connected.

| Function | Description | Returns | | -------------------------------- | -------------------------------------------------- | ------------------- | | runPendingSeeders(options?) | Runs seeders without a successful tracking record | SeederRunResult[] | | runSeederByName(name, options?)| Force-runs one seeder, even if already executed | SeederRunResult[] | | getSeederStatuses(options?) | Lists pending, success, and failed seeders | SeederStatus[] | | resetSeeder(name, options?) | Deletes the tracking record so a seeder can rerun | Promise<void> |

Adapters

Import an adapter from its subpath and build it from your ORM's connection.

| ORM | Import | Factory | | --------- | ------------------------ | ---------------------------------------- | | Prisma | pg-seed-kit/prisma | prismaAdapter(prisma) | | Drizzle | pg-seed-kit/drizzle | drizzleAdapter(db, { close? }) | | TypeORM | pg-seed-kit/typeorm | typeormAdapter(dataSource) | | Sequelize | pg-seed-kit/sequelize | sequelizeAdapter(sequelize) |

Config

Config is loaded from pg-seed-kit.config.js (or .cjs/.mjs), the "pg-seed-kit" key in package.json, or inline options.

| Option | Type | Default | Description | | ------------- | -------------------------- | -------------- | ---------------------------------------------------- | | seedersPath | string \| () => string | (required) | Directory containing seeder files | | tableName | string | "seeders" | Table used to track execution | | filePattern | RegExp | /^\d{14}-.+\.seeder\.(ts\|js\|mjs\|cjs)$/ | Pattern that matches seeder files | | adapter | Adapter | (none) | A live adapter, for calling the API from your app | | connect | () => Promise<Adapter> | (none) | Used by the CLI to open a connection and adapter |

CLI

npx pg-seed-kit create <name>    # Scaffold a new seeder file
npx pg-seed-kit status           # List seeders and statuses
npx pg-seed-kit run              # Run all pending seeders
npx pg-seed-kit run <name>       # Force-run one seeder by name
npx pg-seed-kit reset <name>     # Mark a seeder as pending

status, run, and reset use your config's async connect() to open a connection, then close it when done. run exits non-zero if any seeder fails.

Contributing

Submit a pull request or open an issue on GitHub.

License

MIT