Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ldbjs

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldbjs - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

16

json.js

@@ -42,2 +42,18 @@ // json module

}
json.delete = (path, db, file, args, index, callback)=>{
fs.readFile(`${path}/${db}/${file}.json`, (err, data)=>{
if(err) throw err;
let json = JSON.parse(data);
if(args === '' || args === null || args === undefined) delete json[index];;
if(args !== '' && args !== null && args !== undefined) delete json[args][index];;
fs.writeFile(`${path}/${db}/${file}.json`, JSON.stringify(json), (err)=>{
if(err) throw err;
if(callback) callback();
});
});
}
// push data to json field array

@@ -44,0 +60,0 @@ json.push = (path, db, file, args, index, push, callback)=>{

2

package.json
{
"name": "ldbjs",
"version": "1.7.0",
"version": "1.8.0",
"description": "Create and manage local db files and data",

@@ -5,0 +5,0 @@ "main": "./index.js",

# ldbjs
A lib to create and manage local db files and data, whit a simple send and get system,
save any data, html content, js objects and arrays, json, some texts, anything.
save any data, html content, js objects and arrays, JSON, some texts, anything.

@@ -192,3 +192,3 @@

### JSON insert
### JSON insert and delete

@@ -217,2 +217,8 @@ ```javascript

ldb.json.insert('.', 'myJSONDBName', 'myJSONFileName', 'parents', 'bro', 'Daniel');
// to create new property
ldb.json.insert('.', 'myJSONDBName', 'myJSONFileName', null, 'lastName', 'Drake');
// to delete a property
ldb.json.delete('.', 'myJSONDBName', 'myJSONFileName', null, 'parents');
```

@@ -219,0 +225,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc