Skip to content

Commit

Permalink
Update readme [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsJonQ committed Sep 28, 2017
1 parent 746feff commit 2920832
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
67 changes: 66 additions & 1 deletion README.md
Expand Up @@ -2,4 +2,69 @@

This is the Node port of our [PHP Specter library](https://github.com/helpscout/specter).

Still WIP!
**Still WIP!**


## Installation

```
npm install @helpscout/specter --save-dev
```


## Demonstration

Work together among your development teams to spec a new endpoint and create a
Specter JSON file that defines your new endpoint. This is a Specter JSON file (`customer.json`):

```json
{
"__specter": "Sample customer record",
"id": "@randomDigitNotNull@",
"fname": "@firstName@",
"lname": "@lastName@",
"company": "@company@",
"jobTitle": "@jobTitle@",
"background": "@catchPhrase@",
"address": {
"city": "@city@",
"state": "@stateAbbr@",
"zip": "@postcode@",
"country": "@country@"
},
"emails": ["@companyEmail@", "@freeEmail@", "@email@" ]
}
```

Generate the fixture data based on the spec data model:

```js
import { getFixture } from '@helpscout/specter'

getFixture('customer')
```


The output will be:
```json
{
"__specter":"Sample customer record",
"id":6,
"fname":"Glenda",
"lname":"Trantow",
"company":"Kerluke, Rodriguez and Wisoky",
"jobTitle":"Power Generating Plant Operator",
"background":"Configurable multi-state standardization",
"address":{
"city":"Georgiannachester",
"state":"TX",
"zip":"89501",
"country":"Afghanistan"
},
"emails":[
"dward@friesen.org",
"nwisozk@gmail.com",
"juliet.dooley@yahoo.com"
]
}
```
1 change: 0 additions & 1 deletion index.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": false,
"description": "JSON API Mocking and Testing for Node",
"main": "index.js",
"main": "src/index.js",
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"start": "npm run dev",
Expand Down

0 comments on commit 2920832

Please sign in to comment.