- Clone the repository.
- run
npm install
to install dependencies. - run
npx nodemon --ignore '*.json'
to start the application. - To validate:
- From an api, you can change the "apiUrl" variable in
index.js
file, and make sureio/input.json
is empty. - Custom JSON data, simply paste the data in
input.json
underio
folder.
- From an api, you can change the "apiUrl" variable in
- You will see a
success
orInvalid JSON
in terminal.- If success, then you can check
output.json
(inio
folder) for the output.
- If success, then you can check
Input: (io/input.json
)
{
"firstName": "John",
"age": "30",
"rich": "true",
"cars": [
{ "carName": "Ford", "models": ["Fiesta", "Focus", "Mustang"] },
{ "carName": "BMW", "models": ["320", "X3", "X5"] },
{ "carName": "Fiat", "models": ["500", "Panda"] }
]
}
Output: (io/output.json
)
{
"fName": "John",
"age": 30,
"rich": true,
"cars": [
{
"cName": "Ford",
"models": ["Fiesta", "Focus", "Mustang"]
},
{
"cName": "BMW",
"models": ["320", "X3", "X5"]
},
{
"cName": "Fiat",
"models": ["500", "Panda"]
}
]
}
In file tests.md