Random date. Also formats date according to "format" string. Format string may consist of any characters, but some of them considered tokens, and will be replaced by appropriate value from date.
Possible tokens include:
Longer tokens take precedence over shorter ones (so "MM" will aways be "04", not "44" in april).
All we ever faced the problem of lack of information in our app. All interfaces seem lifeless and empty. Debugging with no data is also not simple.
I think that each of us has at least once in their lives created a bunch of files withJSONdata, but they were just one object propagated without unique fields. JSON Generator was created in order to help with this. It provides an opportunity generate any data and in any quantity. Edit template, click "Generate" and you're done.
JSON Generator has a convenient syntax. You can specify JavaScript object for template that you see in the left box. It will be cloned in infinite depth. Fields may have any name and value, but it must be valid JavaScript. Values may contain one or more template tags. When you generate the data source object to be copied several times and the place of tags will be inserted random values. You can resize template field by dragging center divider.
You can copy the generated JSON to clipboard by clicking "Copy". If you click "Save", JSON will be stored on the server and you can download generated file by clicking "Download" button or access it via ajax-request by URL that will be copied to clipboard after clicking "Copy URL" button. Yes, JSON Generator canJSONP:) Generated files are stored 30 days and their size does not exceed 150 kB. Size appears at the top right of the field with the generated data. If file size text is red - file is too large for saving on server, but you can copy it to your clipboard and save locally to *.json file.
JSON Generator remembers your last template in localStorage. If you want to reset it, click "Reset" button or clear template field and refresh page.
If you have found a bug, you have a suggestion for improving the application or vay just want to thank me, click on "Feedback".
[
'{{repeat(5)}}',
{
id: '{{index}}',
guid: '{{guid}}',
picture: 'http://placehold.it/32x32',
age: '{{numeric(20,40)}}',
name: '{{firstName}} {{lastName}}',
gender: function(idx) {
return this.bool() ? 'male' : 'female';
},
company: '{{company}}',
phone: '{{phone}}',
email: '{{email}}',
address: '{{numeric(10000,40000)}}, {{city}}, {{street}}',
about: '{{lorem(50,100)}}',
registered: '{{date(YYYY-MM-ddThh:mm:ss Z)}}',
tags: [
'{{repeat(7)}}',
'{{lorem(1)}}'
],
friends: [
'{{repeat(3)}}',
{
id: '{{index}}',
name: '{{firstName}} {{lastName}}'
}
]
}
]