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

mockaroni

v1.0.0

Published

Tool for high-speed mock data generation

Downloads

52

Readme

Mockaroni

codecov npm npm npm node-current

mockaroni is a tool for fast generating mock javascript entities.

Usage

Input:

import { replicate, str, num, oneOf, date, listOf, text } from 'mockaroni'

interface Worker
{
    name: string;
    age: number;
    position: 'manager' | 'director' | 'clerk';
    dateOfEmployment: Date;
    achievements: Array<'owl' | 'hard worker' | 'coffee lower' | 'gambler'> | null;
    place: {
        officeId: string;
        floor: number;
    };
    biography: string;
}

// Spawn 100 workers schema
const workers: Array<Worker> = replicate({
    size: 100,
    schema: () => ({
        // Spawn capitalized string of chars with size in range of 4 to 8
        name: text({ size: 1, type: 'names' }),

        // Spawn number from 15 to 90
        age: num({ min: 15, max: 90 }),

        // Select on of the options provided in list
        position: oneOf({ list: ['manager', 'director', 'clerk'] as const }),

        // Spawn date in selected edges
        dateOfEmployment: date({ min: new Date('2018'), max: new Date('2020') }),

        // Spawn list of achievements. Count of achievements can be from 1 to 4, or null
        achievements: listOf({
            list: ['owl', 'hard worker', 'coffee lower', 'gambler'] as const,
            size: num({ min: 1, max: 4 }),
            nullable: true,
        }),

        place: {
            // Spawn 10 length alphanumeric string
            officeId: str({ type: 'alphanumeric', size: 10 }),
            // Spawn number from 1 to 20
            floor: num({ min: 1, max: 20 }),
        },

        // Generate text with 10-30 words
        biography: text({ size: num({ min: 10, max: 30 }) }),
    }),
})

console.log(workers)

output:

[
    {
        name: 'Annie',
        age: 74,
        position: 'manager',
        dateOfEmployment: 2019-10-24T11:20:41.367Z,
        achievements: [ 'hard worker', 'hard worker', 'hard worker' ],
        place: { officeId: 'eg2wqrm3q5', floor: 17 },
        biography: 'muddle abandoned clear stupid obtainable earn arm lumber nostalgic race toothsome reflective offer identify tow woozy butter parcel smile dapper tow shivering'
    },
    {
        name: 'Lachlan',
        age: 74,
        position: 'clerk',
        dateOfEmployment: 2018-07-01T14:04:21.348Z,
        achievements: null,
        place: { officeId: '92b687038k', floor: 7 },
        biography: 'raise frightened word learned shame hellish sleep sheep direful cable absurd'
    },
    {
        name: 'Hamzah',
        age: 49,
        position: 'director',
        dateOfEmployment: 2019-01-24T22:33:43.132Z,
        achievements: null,
        place: { officeId: 'jfscywmz4n', floor: 19 },
        biography: 'parcel magic craven identify frightened mint toothsome zippy protect huge shivering sea clever rat actually filthy kittens'
    },
    ...
]

Install

Library can be install via packet manager like npm or yarn

yarn add mockaroni

or

npm install mockaroni

Then, you can import it like commonjs or es6 import

import { num, text } from 'mockaroni'
// or
const { num, text } = require('mockaroni')

Browser

You also can download