you can replace all propertys to file via file.replace function
file.replace
const json = require("jsonbyte"); const file = new json("./file.json") /* { "username": "user", "password": "pass" } */ file.replace({ firstName: "Tommy", secondName: "Jimmy" }).save(); /* { "firstName": "Tommy", "secondName": "Jimmy" } */
Last updated 2 years ago