Json-schema-faker

json-schema-faker

JSON-Schema + fake data generators

Use JSON Schema along with fake generators to provide consistent and meaningful fake data.

Get it: npm install --save json-schema-faker

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const jsf = require('json-schema-faker');

const schema = {
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "faker": "name.findName"
    },
    "email": {
      "type": "string",
      "faker": "internet.email"
    }
  },
  "required": [
    "name",
    "email"
  ]
};


console.log(jsf(schema));


/*

^ Would log something like:

{
  "name": "Annetta Weimann",
  "email": "[email protected]"
}
*/

GIF FTW!

json-schema-faker

P.S: Don't forget to checkout their web-app!

Suggest a module

Comments