@helpscout/helix

A Faker-powered fixture generator for Javascript

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
183Jun 9, 2021Nov 2, 2017Minified + gzip package size for @helpscout/helix in KB

Readme

Helix 💠

Build Status Coverage Status npm version

A fixture generator for Javascript, powered by Faker.

Helix allows you to quickly (and reliably) generate fixture data to be hydrated into Javascript components/views (like React, Vue, Backbone, etc…).

Install

npm install @helpscout/helix --save-dev

Documentation

Check out our documentation for more info!

Basic usage

The createSpec function is used to define your fixture spec. Helix comes with an adjusted version of Faker.js, which also needs to be imported. Note, the API for Helix's faker is the exact same as Faker.js.

import { createSpec, faker } from '@helpscout/helix'

const CustomerSpec = createSpec({
  id: faker.datatype.number()
  fname: faker.name.firstName()
  lname: faker.name.lastName()
  company: faker.company.companyName()
})

const fixture = CustomerSpec.generate()

// Output
// {
//   id: 12339041,
//   fname: 'Alice',
//   lname: 'Konigsberg',
//   company: 'Smiths Co.'
// }

For a full list of Faker methods, check out their documentation.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.