0.2.0 • Published 3 years ago

@helpscout/helix v0.2.0

Weekly downloads
531
License
MIT
Repository
github
Last release
3 years ago

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.

0.2.0-0

3 years ago

0.2.0

3 years ago

0.1.3-0

3 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago