ezyjson is a JavaScript library made for help you for write and read in JSON.
ezyjson is the easier library for do this. ezyjson have a simple class and some cool function.
For use ezyjson, import the json class from the ezyjson folder.
const { json } = require("ezyjson");
For get the content of a file, you need to make:
let ezyjson = new json({
filePath: "path to the file as a string",
returnErrors: true // or false if you don't want that ezyjson returns all errors.
});
ezyjson.getContent()
The function returns the content. For get it in console, just put it in a console.log
let ezyjson = new json({
filePath: "path to the file as a string",
returnErrors: true // or false if you don't want that ezyjson returns all errors.
});
console.log(ezyjson.getContent()); // Log all of the content of the file.
Is there another functions?
Yeah! There is another functions and some cool functions!
ezyjson.watch({
interval: 2000, // The time in milliseconds
persistent: true, // Define if the function is call all the time.
});
ezyjson.deleteFolder("path to folder"); // or name of the folder if the folder is in the same folder that the file.
ezyjson.addKey("key name" /* String */, "the value of the key"); // String, Number of Boolean.