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

mockr.js

v1.0.2

Published

mockr.js is a lightweight npm package that simplifies the generation of realistic mock data for various use cases in development and testing.

Downloads

10

Readme

mockr.js

mockr.js is a powerful and flexible library designed to simplify the process of generating mock data for testing and development purposes. It supports a wide range of data types, including names, addresses, emails, and much more, making it an ideal choice for developers looking to create realistic and varied datasets.

Features

  • Wide Range of Data Types: Generate mock data for names, emails, addresses, credit card numbers, and many other types.
  • Customizable: Easily tailor the generated data to fit your specific needs.
  • Easy to Use: Simple API and clear documentation to get you started quickly.
  • Open Source: Freely available for personal and commercial use under the MIT license.

Getting Started

Prerequisites

  • Node.js (version 20.x or higher recommended)

Installation

To install mockr.js, run the following command in your project directory:

npm install mockr.js
# or
yarn add mockr.js
# or
bun add mockr.js

Types

| Name | Function | Possible Variants | Responses | |---------------|-------------------------------------------------|-----------------------------------------------------|---------------------------------------| | Address | generateAddress() | 127 | Street, City, ZIP, State, Country | | Browser Agent | generateBrowserAgent() | 3.000 | Browser Agent | | Company | generateCompany() | 3.317.520 | Name, Job Title, Department, Location | | Contact | generateContact() | 8.498.675 | Email, Phone, Mobile, Fax | | Credit Card | generateCreditCard() | 4.800.000.000.000.000.000.000.000 | Holder, Number, Type, Expire, CVV | | Date | generateDate() | ∞ | Date | | Date and Time | generateDateAndTime() | ∞ | Date, Time | | Domain | generateDomain() | 50 | Domain | | Geolocation | generateGeolocation() | 9.007.199.254.740.992 | Geolocation | | IBAN | generateIBAN() | 3.656.158.440.062.976 | IBAN | | IPv4 | generateIPv4() | 4,294,967,296 | IPv4 | | IPv6 | generateIPv6() | 340.282.366.920.938.463.463.374.607.431.768.211.456 | IPv6 | | MAC | generateMAC() | 281.474.976.710.656 | MAC | | Name | generateName() | 9200 | First Name, Last Name | | SWIFT | generateSWIFT() | 20 | SWIFT | | Time | generateTime() | 86,400,000 | Hour, Minute, Second, Millisecond | | Timezone | generateTimezone() | 139 | Timezone | | URL | generateURL() | 78.364.164.096 | URL |

Contributing

We welcome contributions to mockr.js! If you're interested in helping improve the project.

Support

If you encounter any issues or have questions, please file a bug report or feature request through our GitHub Issues.

License

mockr.js is open-source software licensed under the MIT license.