writejson
Write stringified object to file.
Install
npm i writejson --save
How to use?
To handle formating optional argument options
could be used according to JSON.stringify.
API
writejson(name, object[, options], callback)
Asynchonouse write stringified object.
const writejson = ; const error = await ; if error console; const options = replacer: 'hello' // properties to put in json space: 4 // default space count eof: true // default new line at end of file encoding: 'utf8' // default mode: '0o666' // default flag: 'w' // default; await ;
writejson.sync(name, object[, options])
Synchonouse write stringified object.
try writejson; catcherror console;
writejson.sync.try(name, object[, options])
Synchonouse try to write stringified object.
writejsonsync;
License
MIT