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

@arraypress/seed

v1.0.0

Published

Random data generators for seed scripts — names, emails, dates, IPs, and more.

Readme

@arraypress/seed

Random data generators for seed scripts and test fixtures. Realistic names, emails, dates, IPs, countries, and user agents.

Zero dependencies. Works in any JS runtime.

Installation

npm install @arraypress/seed

Usage

import {
  randomName, randomEmail, randomDate, randomIP,
  randomCountry, pick, randInt, escapeSQL, generate, uniqueFrom,
} from '@arraypress/seed';

// Generate 50 test customers
const customers = generate(50, (i) => ({
  id: i + 1,
  name: randomName(),            // 'Emma Johnson'
  email: randomEmail(),           // '[email protected]'
  country: randomCountry(),       // 'DE'
  created_at: randomDate(400),    // '2025-08-14 09:23:41'
}));

// Build SQL
for (const c of customers) {
  console.log(`INSERT INTO customers (name, email, country, created_at)
    VALUES (${escapeSQL(c.name)}, ${escapeSQL(c.email)}, ${escapeSQL(c.country)}, ${escapeSQL(c.created_at)});`);
}

API

Core Utilities

pick(['usd', 'usd', 'gbp', 'eur'])     // weighted random pick
randInt(500, 9900)                       // random integer
uniqueFrom(randomEmail, 50)             // 50 unique emails
generate(100, (i) => ({ id: i + 1 }))   // batch generate

Generators

randomFirstName()     // 'Emma'
randomLastName()      // 'Johnson'
randomName()          // 'Emma Johnson'
randomEmail()         // '[email protected]'
randomDate(365)       // '2025-08-14 09:23:41' (past year)
randomDateBetween('2025-01-01', '2025-12-31')  // within range
randomIP()            // '142.58.201.33'
randomUserAgent()     // 'Mozilla/5.0 (Windows...) Chrome/120...'
randomCountry()       // 'DE'

SQL Helper

escapeSQL("O'Brien")     // "'O''Brien'"
escapeSQL(null)          // 'NULL'
escapeSQL(42)            // '42'
escapeSQL(true)          // '1'

Real-World Example

import { generate, randomName, randomEmail, randomCountry, randomDate, randomIP,
         pick, randInt, uniqueFrom, escapeSQL } from '@arraypress/seed';

// Unique product names
const productNames = uniqueFrom(
  () => `${pick(adjectives)} ${pick(nouns)} Vol. ${randInt(1, 50)}`,
  100
);

// Customers
const customers = generate(50, () => ({
  name: randomName(),
  email: randomEmail(),
  country: randomCountry(),
  created_at: randomDate(400),
}));

// Orders with weighted status
const statuses = ['completed', 'completed', 'completed', 'completed',
                  'partially_refunded', 'refunded'];

const orders = generate(1000, (i) => ({
  id: `pi_test_${String(i + 1).padStart(5, '0')}`,
  email: pick(customers).email,
  status: pick(statuses),
  amount: randInt(5, 99) * 100,
  currency: pick(['usd', 'usd', 'usd', 'gbp', 'eur']),
  country: randomCountry(),
  ip: randomIP(),
  created_at: randomDate(365),
}));

TypeScript

Full type definitions included.

import { generate, randomName, pick } from '@arraypress/seed';

interface Customer {
  name: string;
  email: string;
}

const customers: Customer[] = generate(50, () => ({
  name: randomName(),
  email: randomEmail(),
}));

License

MIT