1.0.5 • Published 4 years ago
resto-json v1.0.5
Resto-json
resto-json is a powerful json generator tool for building frontend Applications without delay. It gives user control of generating massive ammount of unique json data with minimum lines of code.
Installation
Install resto-json
npm install resto-jsonImporting
// Using Node.js `require()`
const restoJson = require("resto-json");
// Using ES6 imports
import restoJson from 'resto-json';To generate unique users data
// jsonData(<listSize>,<listType>)
restoJson(2, "users")Example for API
const express = require("express");
const restoJson = require("resto-json");
const app = express();
app.get("/users", (req, res) => {
res.send(restoJson(2, "users"));
});
app.listen(3000, () => console.log("Example app is listening on port 3000."));Browser
http://localhost:3000/usersResults
{
"users": [
{
"_id": "6261312ce9fc2b6f4ea8cff5",
"firstName": "Victor",
"lastName": "Jurgenson",
"domain": "gmail.com",
"email": "VictorJur43764@gmail.us",
"age": 65,
"gender": "male",
"phone": "+91 9966376132",
"birthDate": "1989-3-22",
"bloodGroup": "AB-negative",
"height": 234,
"weight": 65
},
{
"_id": "6261312c6a26b82768508fa9",
"firstName": "Matthew",
"lastName": "Hylan",
"domain": ".com",
"email": "MatthewHyl46030@cafepress.com",
"age": 66,
"gender": "male",
"phone": "+91 9931396090",
"birthDate": "2010-10-16",
"bloodGroup": "B-positive",
"height": 225,
"weight": 66
}
]
}Datatypes
| Users | Data type |
|---|---|
| _id | string |
| firstName | string |
| lastName | string |
| gender | string |
| age | number |
| string | |
| phone | string |
| domain | string |
| birthDate | string |
| bloodGroup | string |
| height | number |
| weight | number |
Version Release Schedule
If you require the absolute latest version of resto-json the master branch @ https://github.com/vinayakPandey7/resto-json should always be up to date and working.