write-json-file

v0.0.7arrow_drop_down
v0.0.7
v0.0.6
v0.0.5
v0.0.4
v0.0.3
v0.0.2
v0.0.1
STATUS
Passing
DOWNLOADS
95
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
N/A
Write json to file - (string or object)
1 contributor
Install write-json-file as a package?
Copied
npm i @bit/amit.json.global.write-json-file
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
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 file

Pass

writeJsonFile write json string to file

Pass

writeJsonFile validate written file

Pass

writeJsonFile when sending broken json should get exception

Pass
Help and resources