Closed manidlou closed 7 years ago
Please let me know if you think it is reasonable to add these two functions or no need for them :smile:
updateFile(filepath, obj, cb)
updateFileSync(filepath, obj)
They read the file, update the file contents with obj using something like Object.assign(), then write back the updated contents to the same file.
obj
Object.assign()
Related/duplicate of https://github.com/jprichardson/node-jsonfile/issues/52.
Please let me know if you think it is reasonable to add these two functions or no need for them :smile:
updateFile(filepath, obj, cb)
updateFileSync(filepath, obj)
They read the file, update the file contents with
obj
using something likeObject.assign()
, then write back the updated contents to the same file.