global/write-json-file
v0.0.7
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
3
In json
MIT
PUBLIC
63
1     DEPENDENCIES
BuildPass

Write json to file - (string or object)

Use global/write-json-file in your project
npm i @bit/amit.json.global.write-json-file

writeJsonFile (file:string, data)

Write json to file - (string or object)

Example

```js
const writeJsonFile = require('bit/global/write-json-file');
const jsonFile = "/tmp/exampleFile.json";
writeJsonFile(jsonFile,{isThisReal:ture,author:amit}).catch(err => console.log(err));
```

Arguments

file: string

path to file(path must exist)

data

json string or Object to write

Returns

promise(jsonString)

Test Summary


writeJsonFile write json object to filePass
writeJsonFile write json string to filePass
writeJsonFile validate written filePass
writeJsonFile when sending broken json should get exceptionPass