Giter Club home page Giter Club logo

chaca's Introduction

๐ŸŒš Think your data and let Chaca create it.

๐Ÿ˜€ Intro

Welcome to Chaca a powerful TypeScript library that revolutionizes mock data generation for testing and development processes. With Chaca, you can effortlessly generate realistic and diverse fake data to simulate different scenarios. Whether you're building a web application, a mobile app, or an API, Chaca's extensive support ensures seamless integration into your projects.

What's more, Chaca allows you to export the generated data to various formats, making it easy to share and analyze. Boost your development workflow and eliminate tedious manual data creation with Chaca.

๐Ÿ“ฆ Installation

npm install chaca

๐Ÿ“˜ Documentation

Visit our website to read the documentation. Chaca Docs

๐Ÿ˜Ž Usage

import { chaca, schemas } from "chaca";

const movieSchema = chaca.schema({
  id: schemas.id.uuid(),
  authors: {
    type: schemas.person.fullName({ language: "es" }),
    isArray: { min: 1, max: 3 },
  },
  image: schemas.image.film(),
  likes: schemas.dataType.int({ min: 0, max: 500000 }),
  category: chaca.enum(["Horror", "War", "History", "Comedy"]),
  adultMovie: ({ currentFields: docFields }) => {
    return (
      docFields.category === "Horror" ||
      docFields.category === "War" ||
      docFields.category === "Action"
    );
  },
});

// Generate 20 objects with the defined schema
const docs = postSchema.generate(20);

/*
[
  {
    id: "4136cd0b-d90b-4af7-b485-5d1ded8db252",
    authors: ["Olivia Gonzalez Gomez", "Santiago Torres Gil"],
    image:
      "https://images.unsplash.com/photo-1534684686641-05569203ecca?crop=entropy&cs=tinysrgb&fm=jpg&ixid=MnwzNTM2NjZ8MHwxfHNlYXJjaHw1fHxmaWxtfGVufDB8fHx8MTY2Njk3MDgyMQ&ixlib=rb-4.0.3&q=80",
    likes: 21456,
    category: "Horror",
    adultMovie: true,
  },
  ...rest, // 19 more documents
];
*/

// Generate 20 objects and export them in a json file
await movieSchema.generateAndExport(20, {
  fileName: "movies",
  format: "json",
  location: "./folder",
});

๐Ÿ•น๏ธ CLI

See CLI guide

๐ŸŒ Try our REST API

If you don't want to use our npm package you can use our REST API to create your mock data

๐Ÿ—‚๏ธ Changelog

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

Contributing

The Chaca project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues, and more!. See CONTRIBUTING.md

License

MIT

chaca's People

Contributors

chacaponquin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cdrobaina01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.