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

mimic-json

v1.0.3

Published

Generate mock JSON data from schema or examples

Readme

🧪 mimic-json

mimic-json is a lightweight and flexible TypeScript/JavaScript library for generating mock JSON data from simple schema definitions. It's ideal for testing, prototyping, seeding dev environments, or building realistic UI placeholders.

npm version License: ISC Types Build Status Downloads


✨ Features

  • 🧱 Schema-based mock data — Define your own structure.
  • 🔢 Rich data types — Names, emails, numbers, UUIDs, dates, booleans, and more.
  • 🧠 TypeScript support — Fully typed for a smooth developer experience.
  • ⚡ Fast & lightweight — Zero runtime dependencies.
  • 📚 Easy to use — Simple API for quick integration.

📦 Installation

Install the package via npm or Yarn:

# Using npm
npm install mimic-json

# Using Yarn
yarn add mimic-json

🚀 Quick Usage Here’s how you can use mimic-json to generate mock data:

import { mimic } from 'mimic-json';

const userSchema = {
  id: 'uuid',
  name: 'name',
  email: 'email',
  age: 'number',
  isActive: 'boolean',
  joinedAt: 'date',
  address: {
    type: 'object',
    schema: {
      street: 'address',
      city: 'city',
      country: 'country',
    },
  },
  phoneNumbers: {
    type: 'array',
    schema: {
      type: 'phone',
    },
    count: 2,
  },
  friends: {
    type: 'array',
    count: 2,
    schema: {
      id: 'uuid',
      name: 'fullName',
    },
  },
};

const mockUser = mimic(userSchema);

console.log(mockUser);

🧾 Sample Output

{
  "id": "8b92d3e2-4ed4-4e19-a02f-7195e9fcebc3",
  "name": "Alice Johnson",
  "email": "[email protected]",
  "age": 32,
  "isActive": true,
  "joinedAt": "2025-04-21T14:35:22.000Z",
  "address": {
    "street": "123 Main St",
    "city": "San Francisco",
    "country": "USA"
  },
  "phoneNumbers": [
    "(555) 123-4567",
    "(555) 987-6543"
  ],
  "friends": [
    {
      "id": "c9c18f93-4a87-445c-92d7-b008ff8121ab",
      "name": "John Doe"
    },
    {
      "id": "d62c9323-5e4d-490d-9a56-d519a79ea181",
      "name": "Emily Smith"
    }
  ]
}

📚 Supported Types

SchemaValue Description uuid Random UUID v4 name Full name email Email address number Integer number boolean Boolean (true/false) date ISO string date address Street address phone Phone number url Random URL text Random sentence

🛠 Development If you’d like to contribute or run the project locally, follow these steps:

  1. Clone the repository:
git clone https://github.com/yourusername/mimic-json
cd mimic-json
  1. Install dependencies:
npm install

3.Build the project:

npm run build

4.Run tests:

npm test

🤝 Contributing Contributions, ideas, and issues are welcome! If you’d like to contribute:

Fork the repository. Create a new branch for your feature or bugfix. Submit a pull request with a clear description of your changes.

📄 License This project is licensed under the ISC License. © 2025 Somesh Nautiyal

✅ Next Steps Replace yourusername with your actual GitHub username in the links and badges. Push the updated README.md to your repository. npm version patch npm publish

Happy coding! 🚀

Key Improvements:

  1. Added Build Status Badge:

    • Displays the status of CI/CD workflows (replace yourusername with your GitHub username).
  2. Improved Formatting:

    • Organized sections with clear headings and consistent formatting.
  3. Detailed Usage Example:

    • Included a sample schema and output for better clarity.
  4. Contributing Section:

    • Added clear steps for contributing to the project.
  5. Links Section:

    • Added links to the npm package, GitHub repository, and license.
  6. Next Steps:

    • Provided instructions for replacing placeholders and publishing the package.

This README.md is now polished and ready for your published npm package. Let me know if you need further assistance!