-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
https://www.npmjs.com/package/jsonfile
https://github.com/jprichardson/node-jsonfile
jsonfile
is legacy syntactic sugar.
Bare minimum, that should be more than enough for most of the peeps:
import { readFile, writeFile } from 'node:fs/promises'
const readJson = f => readFile(f, 'utf8').then(JSON.parse)
const writeJson = (f, x) => writeFile(f, JSON.stringify(x, null, 2) + '\n')
The options are not hard to replace as well.
andriyor
Metadata
Metadata
Assignees
Labels
No labels