Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nimabht/json-push-data-node-module
Node package - json
https://github.com/nimabht/json-push-data-node-module
json-api node-module npm-module npm-package
Last synced: about 2 months ago
JSON representation
Node package - json
- Host: GitHub
- URL: https://github.com/nimabht/json-push-data-node-module
- Owner: Nimabht
- Created: 2023-02-24T08:28:12.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-24T08:28:17.000Z (almost 2 years ago)
- Last Synced: 2024-12-01T13:11:06.051Z (about 2 months ago)
- Topics: json-api, node-module, npm-module, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/json-update-data
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js - json-update-data
You can use this module for updating your json files in easiest way :)
## Installation
Install json-update-data
```bash
npm install json-update-data
```
## Write data```javascript
const Jud = require("json-update-data");
const file = "/tmp/data.json";
const data = [
{name: "Jeff"}
];
Jud.writeData(file, data);```
## Add new data
```javascript
const Jud = require("json-update-data");
const file = "/tmp/data.json";
const newData = [
{name: "Jeff"}
];
Jud.pushData(file, newData);```
## Delete data```javascript
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```javascript
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
- [@Nimabht](https://github.com/Nimabht)