Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helpscout/helix
💠Helix: A fixture generator for Javascript, powered by Faker.js
https://github.com/helpscout/helix
faker fixtures generator javascript open-source specs
Last synced: 2 months ago
JSON representation
💠Helix: A fixture generator for Javascript, powered by Faker.js
- Host: GitHub
- URL: https://github.com/helpscout/helix
- Owner: helpscout
- License: mit
- Created: 2017-11-02T18:58:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T18:14:14.000Z (about 2 years ago)
- Last Synced: 2024-11-08T11:42:35.806Z (3 months ago)
- Topics: faker, fixtures, generator, javascript, open-source, specs
- Language: JavaScript
- Homepage:
- Size: 1.05 MB
- Stars: 20
- Watchers: 9
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Helix ðŸ’
[![Build Status](https://travis-ci.org/helpscout/helix.svg?branch=master)](https://travis-ci.org/helpscout/helix) [![Coverage Status](https://coveralls.io/repos/github/helpscout/helix/badge.svg?branch=master)](https://coveralls.io/github/helpscout/helix?branch=master) [![npm version](https://badge.fury.io/js/%40helpscout%2Fhelix.svg)](https://badge.fury.io/js/%40helpscout%2Fhelix)
> A fixture generator for Javascript, powered by [Faker](https://github.com/marak/Faker.js/).
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](./docs)** for more info!
## Basic usage
The `createSpec` function is used to define your fixture spec. Helix comes with an adjusted version of [Faker.js](https://github.com/marak/Faker.js/), which also needs to be imported. Note, the API for Helix's faker is the **exact** same as Faker.js.
```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](https://github.com/marak/Faker.js/#api-methods).