4.2: Generating Seed Data
json-generator.com
[
'{{repeat(25)}}', // repeat 25 times
{
Username: '{{firstName("female")}}', // random female first name
Specialty: '{{random("front", "back", "full")}}', // choose one of the three options randomly
DateOfBirth: '{{date(new Date(1975,0,1), new Date(1999, 11, 31), "YYYY-MM-dd")}}', // random birthday
Password: 'password', // all passwords will just be 'password'
KnownAs: function(){ return this.Username; }, // will just be their username/firstname
Created: '{{date(new Date(2017,0,1), new Date(2018, 3, 1), "YYYY-MM-dd")}}', // dates between 1/1/2017 and 3/1/2018
LastActive: function(){return this.DateCreated; }, // same as date created
Introduction: '{{lorem(1, "paragraphs")}}', // 1 paragraph of lorem ipsum
LookingFor: '{{lorem(1, "paragraphs")}}', // 1 paragraph of lorem ipsum
Interests: '{{lorem(1, "sentences")}}', // 1 sentence of lorem ipsum
City: '{{city()}}', // random city
State: '{{state()}}', // random us state
Photos: [
{
url: function(num) {
return 'https://randomuser.me/api/portraits/women/' + num.integer(1,99) + '.jpg';
}, // queries this api for a random female photo
isMain: true,
description: '{{lorem()}}'
}
]
}
]Last updated