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 🙏

© 2024 – Pkg Stats / Ryan Hefner

data-crafter

v1.0.5

Published

A package to generate mock data for testing

Downloads

25

Readme

Mock Data Generator

Table of Contents

About the Project

A simple npm package to generate mock data for testing purposes. It supports generating various types of mock data such as users, products, addresses, transactions, reviews, and orders.

Installation

  1. Clone the repository:
git clone https://github.com/alexgutscher26/Data-Crafter-Mock-Data-Generator
  1. Install:
npm i data-crafter
  1. Install as Local Package:

If you want to use it as a local package for testing or development purposes, you can install it from a relative path:

npm install ../path/to/data-crafter

Usage

  1. Generate Mock Users
Command: generate:user

Options:

--count (optional): Number of users to generate (default is 1).
--locale (optional): Locale for the generated data (default is 'en').
--output (optional): File path to export the generated data as a JSON file.

Example Usage:

node src/cli.js generate:user --count 5 --locale de --output users.json
  1. Generate Custom Schema Data
Command: generate:custom

Options:

--schema (required): Path to a schema JSON file that defines the data structure.
--count (optional): Number of data items to generate (default is 1).
--locale (optional): Locale for the generated data (default is 'en').
--output (optional): File path to export the generated data as a JSON file.

Example Usage:

node src/cli.js generate:custom --schema ./schema.json --count 10 --output custom_data.json

Example Schema File

(schema.json)

Here's an example of how a schema JSON file might look:

{
    "username": {"type": "string", "length": 10},
    "age": {"type": "integer", "min": 18, "max": 99},
    "email": {"type": "email"},
    "isActive": {"type": "boolean"},
    "createdAt": {"type": "date", "min": "2000-01-01", "max": "2022-12-31"}
}

Contributing

We welcome contributions from everyone! Whether you’re a seasoned developer or just starting, your input can help us improve this project.

Guidelines Code Style: Please follow the existing code style and conventions used in the project. If applicable, run tests to ensure your changes do not break existing functionality.

Documentation: If your changes introduce new features, please update the Readme accordingly. Clear documentation helps users understand how to use the new features.

Issue Tracking: Before starting work on a new feature or bug fix, check the existing issues to see if someone else is already working on it. If you want to work on an unclaimed issue, consider commenting on it to express your interest.

Respect the Community: Be respectful and considerate of other contributors. We strive to maintain a friendly and inclusive environment.

Reporting Issues

If you encounter any bugs or have feature requests, please create a new issue in the issue tracker. Provide as much detail as possible to help us understand and address the problem effectively.

Thank You

Thank you for considering contributing to our project! Every contribution helps us improve and grow. We appreciate your time and effort!

License

This project is licensed under the MIT License.