nicolastakashi / fluent-fakerjs

Build Fake Data using FakerJS with a Fluent API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fluent FakerJS

Fluent FakerJS is a module built on top of FakerJS to help you write fake date using a fluent api.

Instaling

yarn add fluentfaker --dev

// or

npm install fluentfaker --save-dev

Usage

Build JSON Object.

import FluentFaker from 'fluentfaker'

const object = FluentFaker.make()
      .rule('name', rule => rule.name.findName())
      .rule('email', rule => rule.internet.email())
      .rule('jobtitle', rule => rule.name.jobTitle())
      .build();

Build Form Data

import FluentFaker from 'fluentfaker'

const object = FluentFaker.make()
      .rule('name', rule => rule.name.findName())
      .rule('email', rule => rule.internet.email())
      .rule('jobtitle', rule => rule.name.jobTitle())
      .buildAsFormData();

Rules available

Visit FakerJS page to get more details about all methods that can be used in Fluent Faker rules.

Tests

yarn

yarn test

Building Fluent FakerJS

Fluent FakerJS uses typescript and yarn, you just need run yarn to install dependencies and you're welcome to fix a bug or add a new feature.

Feel free to open a issue or send a pull request.

About

Build Fake Data using FakerJS with a Fluent API

License:MIT License


Languages

Language:TypeScript 70.4%Language:JavaScript 29.6%