1.1.3 • Published 11 months ago
flamebase v1.1.3
Flamebase
Flamebase is a simple NPM package that can edit JSON files easily.
Installation
To install Flamebase, simply run the following command in your terminal:
npm i flamebase
Documentation:
Write to JSON file:
const Flamebase = require("flamebase");
Flamebase.write({
Property: "new-property",
Data: "You can put anything here even objects or arrays",
AutoAlign: true, // Auto arrange the file after writing it
JsonFilePath: "./json-file.json"
});
Remove from JSON file:
const Flamebase = require("flamebase");
Flamebase.remove({
Property: "new-property", // The property that you want to delete
AutoAlign: true, // Auto arrange the file after writing it
JsonFilePath: "./json-file.json"
});
Update the JSON file:
const Flamebase = require("flamebase");
Flamebase.update({
Property: "new-property",
Data: ["NEW", "DATA", "HERE"],
AutoAlign: true, // Auto arrange the file after writing it
JsonFilePath: "./json-file.json"
});
Get property value inside the JSON file
console.log(Flamebase.get({
Property: "new-property",
JsonFilePath: "./json-file.json"
}))
Add data to array inside a property:
Flamebase.pushToPropertyArray({
Property: "new-property",
ArrayName: "Array0",
Data: "New Array Data", // Data that you want to add to the array
AutoAlign: true, // Auto arrange the file after writing it
JsonFilePath: "./json-file.json"
})
Remove data from array inside a property:
Flamebase.removeFromPropertyArray({
Property: "new-property",
ArrayName: "Array0",
Data: "New Array Data", // Data that you want to remove from the array
AutoAlign: true, // Auto arrange the file after writing it
JsonFilePath: "./json-file.json"
})