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

@seedwise/core

v1.0.7

Published

Smart database seeding with run-once tracking - Core package

Readme

@seedwise/core

Smart database seeding with run-once tracking. Seeds run like migrations — tracked, idempotent, and predictable.

Why Seedwise?

Traditional seeders run every time, causing duplicate data headaches. Seedwise tracks what's run in a _seedwise_history table — seeds execute once and never again (unless you want them to).

Installation

npm install @seedwise/core @seedwise/knex

Quick Start

1. Create config file (seedwise.config.ts):

import type { SeedwiseConfig } from '@seedwise/core';

const config: SeedwiseConfig = {
  adapter: 'knex',
  connection: './knexfile.ts',
  seedsDir: './seeds',
};

export default config;

2. Create a seed (seeds/001_users.ts):

import type { Knex } from 'knex';
import type { SeedConfig } from '@seedwise/core';

export const config: SeedConfig = {
  mode: 'once',  // Run once, tracked forever
  description: 'Seed initial admin user',
};

export async function seed(knex: Knex): Promise<void> {
  await knex('users').insert({
    email: '[email protected]',
    role: 'admin',
  });
}

3. Run seeds:

npx seedwise run

Seed Modes

| Mode | Behavior | |------|----------| | once | Run one time ever (default) | | always | Run on every seedwise run | | changed | Re-run if file content changes | | manual | Only run with --force or --name |

CLI Commands

seedwise run              # Run pending seeds
seedwise run --dry-run    # Preview what would run
seedwise run --name users # Run specific seed
seedwise status           # Show seed history
seedwise reset            # Clear history (re-run all)
seedwise reset --name X   # Reset specific seed
seedwise unlock           # Force-release stale lock

Configuration Options

All options are optional with sensible defaults:

interface SeedwiseConfig {
  adapter?: string;           // 'knex' (default)
  connection?: string;        // './knexfile.js'
  seedsDir?: string;          // './seeds'
  historyTable?: string;      // '_seedwise_history'
  lockTable?: string;         // '_seedwise_lock'
  timeout?: number;           // 30000 (ms)
  lockTimeout?: number;       // 60000 (ms)
  extensions?: string[];      // ['.js', '.ts']
  sortBy?: 'filename' | 'dependency';
  allowedEnvironments?: string[];
  verbose?: boolean;
}

Seed Configuration

export const config: SeedConfig = {
  mode: 'once',
  description: 'What this seed does',
  environments: ['development', 'staging'],  // Only run in these
  excludeEnvironments: ['production'],       // Never run in these
  dependsOn: ['001_roles'],                  // Run after these seeds
  tags: ['auth', 'critical'],                // Filter with --tag
  transaction: true,                         // Wrap in transaction
  timeout: 60000,                            // Custom timeout
};

Programmatic Usage

import { Seedwise } from '@seedwise/core';
import { KnexAdapter } from '@seedwise/knex';
import Knex from 'knex';

const knex = Knex(config);
const adapter = new KnexAdapter(knex);
const seedwise = new Seedwise({ adapter, seedsDir: './seeds' });

await seedwise.run();
await seedwise.status();
await seedwise.reset();

License

MIT