writeJson

Type:Function
Status:stable
Since:1.0.0
Platform:node
@blackbyte.sugar.node.fs

Write a JSON file. If don’t exist, will be created as well as the directory structure if needed… ( (async)

Params

  1. path*-String

    The file path to write

  2. object*-String

    The object to write in the JSON file

  3. options{}Object

    Options are what you’d pass to [fs.writeJson()](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)

Return

  1. -Promise

    A promise that will be resolved when the writeJson is completed

Example

import { writeJson } from '@blackbyte/sugar/fs';
writeJson('my/cool/file.json', { hello: 'world' }).then(() => {
   // do something on complete...
});

Todo

  • testsnormal