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

seedts

v0.1.1

Published

Type-safe database seeding for TypeScript with React-like JSX syntax

Readme

SeedTS

Type-safe database seeding for TypeScript with React-like JSX syntax

SeedTS is a modern, type-safe database seeding library for TypeScript. It provides a clean, declarative API for defining and executing database seeds with full TypeScript support.

Features

  • 🎯 Type-Safe - Full TypeScript support with type inference
  • ⚛️ JSX Syntax - Familiar React-like JSX for declarative seed definitions
  • 🔌 Database Agnostic - Works with any database through adapters
  • 🚀 Performance - Batch processing, parallel execution, and streaming
  • 🎨 Flexible - Conditional seeding, transformers, hooks, and dependencies
  • 🧪 Testing Tools - Snapshot testing, deterministic seeding, test helpers

Installation

# Using pnpm
pnpm add seedts

# Using npm
npm install seedts

# Using yarn
yarn add seedts

Quick Start

1. Install a database adapter

pnpm add @seedts/adapter-postgresql
# or @seedts/adapter-mysql, @seedts/adapter-sqlite, etc.

2. Configure TypeScript

Add JSX support to your tsconfig.json:

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "seedts"
  }
}

3. Create your first seed

// seeds/users.seed.tsx
import { Seed, Action, Entity, Attribute } from 'seedts/jsx-runtime';
import { PostgreSQLAdapter } from '@seedts/adapter-postgresql';
import { Pool } from 'pg';

const pool = new Pool({ /* your config */ });
const adapter = new PostgreSQLAdapter(pool);

export const UsersSeed = (
  <Seed name="users" adapter={adapter}>
    <Action count={100}>
      <Entity>
        <Attribute
          name="email"
          factory={(ctx) => `user${ctx.index}@example.com`}
        />
        <Attribute
          name="name"
          factory={(ctx) => `User ${ctx.index}`}
        />
        <Attribute
          name="role"
          factory={() => 'user'}
        />
      </Entity>
    </Action>
  </Seed>
);

4. Run your seeds

import { Executor } from 'seedts';
import { UsersSeed } from './seeds/users.seed';

const executor = new Executor([UsersSeed]);

const results = await executor.execute({
  parallel: false,
  transaction: true,
});

console.log('Seeding complete!', results);

Using Faker (Optional)

For more realistic data, install the Faker integration:

pnpm add @seedts/faker

Use it in your seeds:

import { faker } from '@seedts/faker';

<Entity>
  <Attribute name="email" factory={faker.email()} />
  <Attribute name="firstName" factory={faker.firstName()} />
  <Attribute name="lastName" factory={faker.lastName()} />
  <Attribute name="age" factory={faker.int({ min: 18, max: 80 })} />
</Entity>

Using the CLI (Optional)

Install the CLI for a better developer experience:

pnpm add -D @seedts/cli

Add scripts to your package.json:

{
  "scripts": {
    "seed": "seedts run",
    "seed:list": "seedts list",
    "seed:generate": "seedts generate"
  }
}

Run your seeds:

pnpm seed

Available Packages

This is a convenience package that includes the core SeedTS functionality. For advanced use cases, you can install individual packages:

  • @seedts/types - Core TypeScript types and interfaces
  • @seedts/core - Core execution engine
  • @seedts/adapters - Base adapter classes
  • @seedts/cli - Command-line interface
  • @seedts/jsx-runtime - JSX runtime (included automatically)
  • @seedts/faker - Faker.js integration
  • @seedts/testing - Testing utilities
  • @seedts/performance - Performance tools
  • @seedts/import - Import/export utilities
  • @seedts/introspect - Database introspection

Database Adapters

  • @seedts/adapter-postgresql - PostgreSQL adapter
  • @seedts/adapter-mysql - MySQL adapter
  • @seedts/adapter-sqlite - SQLite adapter
  • @seedts/adapter-prisma - Prisma ORM adapter

Documentation

For full documentation, visit https://seedts.dev

Examples

With Dependencies

<Seed name="users" adapter={adapter}>
  <Action count={50}>
    <UserEntity />
  </Action>
</Seed>

<Seed name="posts" dependsOn="users" adapter={adapter}>
  <Action count={100}>
    <PostEntity />
  </Action>
</Seed>

With Conditional Seeding

<Action
  run={process.env.NODE_ENV === 'development'}
  count={50}
>
  <UserEntity />
</Action>

With Transformers

<Attribute
  name="password"
  factory={() => 'password123'}
  transform={hashPassword}
/>

With Hooks

<Seed
  name="users"
  adapter={adapter}
  beforeInsert={(data) => {
    console.log(`Inserting ${data.length} users`);
    return data;
  }}
  onSuccess={(data, metadata) => {
    console.log(`Done! Duration: ${metadata.duration}ms`);
  }}
>
  <Action count={100}>
    <UserEntity />
  </Action>
</Seed>

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

License

MIT © SeedTS Contributors

Support