1.0.0 • Published 2 years ago

json-update-data v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Node.js - json-update-data

You can use this module for updating your json files in easiest way :)

Installation

Install json-update-data

  npm install json-update-data

Write data

const Jud = require("json-update-data");
const file = "/tmp/data.json";
const data = [
  {name: "Jeff"}
];
Jud.writeData(file, data);

Add new data

const Jud = require("json-update-data");
const file = "/tmp/data.json";
const newData = [
  {name: "Jeff"}
];
Jud.pushData(file, newData);

Delete data

const Jud = require("json-update-data");
const file = "/tmp/data.json";
// 2nd parameter : key name in object
// 3nd parameter : Value that assigned to that key
Jud.deleteData(file, "name", "Jeff");

Delete all data

const Jud = require("json-update-data");
const file = "/tmp/data.json";
// 2nd parameter : key name in object
// 3nd parameter : Value that assigned to that key
Jud.deleteAllData(file, "name", "Jeff");

Authors