Get started with json-schema-faker CDN
MIT licensed
JSON Schema Faker generates fake data based on provided JSON schemas.
Tags:- json
- jsonschema
- fake
- mocks
Stable version
Copied!
How to start using json-schema-faker CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with json-schema-faker CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/json-schema-faker.min.js"></script>
</head>
<body>
<button id="generate">Generate Fake Data</button>
<script>
const JsonschemaFaker = require('json-schema-faker');
document.getElementById('generate').addEventListener('click', () => {
const schema = {
title: 'Person',
type: 'object',
properties: {
firstName: { type: 'string' },
lastName: { type: 'string' },
email: { type: 'string', format: 'email' },
phoneNumber: { type: 'string', pattern: '^[0-9]{10}$' },
address: {
type: 'object',
properties: {
street: { type: 'string' },
city: { type: 'string' },
state: { type: 'string' },
postcode: { type: 'string', pattern: '^[0-9]{5}([-0-9]{4})?$' },
country: { type: 'string' },
},
},
},
};
const generatedData = JsonschemaFaker.create(schema);
console.log(generatedData);
});
</script>
</body>
</html>
All versions
0.2.10
0.2.11
0.2.12
0.2.13
0.2.14
0.2.15
0.2.16
0.2.7
0.2.8
0.2.9
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6
0.3.7
0.4.0
0.4.1
0.4.2
0.4.3
0.4.5
0.4.6
0.4.7
0.5.0
0.5.0-rc1
0.5.0-rc10
0.5.0-rc11
0.5.0-rc12
0.5.0-rc13
0.5.0-rc14
0.5.0-rc15
0.5.0-rc16
0.5.0-rc18
0.5.0-rc19
0.5.0-rc2
0.5.0-rc20
0.5.0-rc21
0.5.0-rc23
0.5.0-rc3
0.5.0-rc4
0.5.0-rc5
0.5.0-rc6
0.5.0-rc7
0.5.0-rc8
0.5.0-rc9
0.5.0-rcv.25
0.5.0-rcv.26
0.5.0-rcv.27
0.5.0-rcv.28
0.5.0-rcv.29
0.5.0-rcv.30
0.5.0-rcv.31
0.5.0-rcv.32
0.5.0-rcv.33
0.5.0-rcv.34
0.5.0-rcv.35
0.5.0-rcv.36
0.5.0-rcv.37
0.5.0-rcv.38
0.5.0-rcv.39
0.5.0-rcv.40
0.5.0-rcv.41
0.5.0-rcv.42
0.5.0-rcv.43
0.5.0-rcv.44
0.5.0-rcv.45
0.5.0-rcv.46
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
*** 0.5.6