1.0.2 • Published 4 years ago
prodata-app v1.0.2
How to run this project?
- If NodeJS not installed in your system. Install it from Here.
- Clone the repository.
- Run command
npm iin root folder to install dependencies. - Run command
npm run buildin the root folder to build. - Run command
npm run testin the root folder to test. - That's it.
Installation
npm i prodata-appCode Sample
const { parseJsonFile } = require("prodata-app");
parseJsonFile("./files/demo.json").then((res) => console.log(res));Inputs & Outputs
The input files are from here
First input file 1.json The output
{
"message": [
{
"node": 1,
"result": true
}
]
}Second input file 2.json The output
{
"message": [
{
"node": 1,
"result": false
},
{
"node": 2,
"result": false
},
{
"node": 3,
"result": true
}
]
}Functions
There are two functions
parseJsonFileparseJsonString
ParseJsonFile()
- @params : String. JSON file path
- @returns : Promise. A JSON format text
- @type: : async
ParseJsonString()
- @params : String. JSON string
- @returns : String. A JSON format text
- @type: : sync