Skip to content

React hook for generating fake data for testing and development.

License

Notifications You must be signed in to change notification settings

Bunlong/next-faker

Repository files navigation

next-faker

React hook for generating fake data for testing and development.

NPM JavaScript Style Guide

🔧 Install

next-faker is available on npm. It can be installed with the following command:

npm install next-faker --save-dev

next-faker is available on yarn as well. It can be installed with the following command:

yarn add next-faker --dev

🎁 Features

  • 💌 Addresses - Generate valid looking Addresses, Zip Codes, Street Names, States, and Countries.

💡 Usage

import { useFaker } from 'next-faker';

const Home = () => {
  const { address } = useFaker();

  return (
    <>
      {address.buildingNumber()}
    </>
  );
}

export default Home;

💎 Modules

An in-depth overview of the API methods is available in the documentation. The API covers the following modules:

Module Example Output
Address address.city() Lake Raoulfort
Animal animal.cat() Norwegian Forest Cat
Color color.rgb() #cdfcdc
Commerce commerce.product() Polo t-shirt
Company company.companyName() Zboncak and Sons
Database database.engine() MyISAM
Datatype datatype.uuid() 7b16dd12-935e-4acc-8381-b1e457bf0176

📜 Changelog

Latest version 0.1.0 (2022-06-28):

  • API
    • Datatype: module to generate various primitive values and data types.

Details changes for each release are documented in the CHANGELOG.md.

❗ Issues

If you think any of the next-faker can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

💪 Contribution

We'd love to have your helping hand on contributions to next-faker by forking and sending a pull request!

Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)

How to contribute:

  • Open pull request with improvements
  • Discuss ideas in issues
  • Spread the word
  • Reach out with any feedback

🏆 Contributors

Bunlong
Bunlong

⚖️ License

The MIT License License: MIT