New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

megadb

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

megadb - npm Package Compare versions

Comparing version 1.5.0 to 1.7.0

18

index.js

@@ -240,2 +240,3 @@ const fs = require('graceful-fs'),

- eliminar
- purgeall
- sumar

@@ -385,2 +386,18 @@ - restar

function purgeall() { //retorna true o false
var object_data = global_object[this.database_name]
let old_object = JSON.parse(JSON.stringify(object_data))
global_object[this.database_name] = {}
let save_data = saveJSON(this.path_file_name, global_object[this.database_name], old_object)
if(save_data) {
return true
}
return false
}
//--------------------------------------------------------------------------------------\\
//---------------------------------------------------------------------------------------\\
function sumar(clave, number, split_object) { //retorna promesa

@@ -787,2 +804,3 @@ if(!split_object) split_object = "."

crearDB.prototype.eliminar = eliminar
crearDB.prototype.purgeall = purgeall
crearDB.prototype.sumar = sumar

@@ -789,0 +807,0 @@ crearDB.prototype.restar = restar

6

package.json
{
"name": "megadb",
"version": "1.5.0",
"version": "1.7.0",
"description": "base de datos usando JSON",

@@ -11,3 +11,5 @@ "main": "index.js",

"database",
"JSON"
"JSON",
"db",
"base de datos"
],

@@ -14,0 +16,0 @@ "author": "MegaStar",

@@ -20,3 +20,14 @@ ```

## Changelog
V1.7.0
* Se agregó el metodo purgeall.
V1.5.0
* Se arregló el readme.
V1.4.0
* Se arregló un bug en la funcion obtener.
## Constructor:

@@ -35,2 +46,3 @@ * [crearDB](#crearDB)

* [restar](#restar)
* [purgeall](#purgeall)
* [ordenar](#ordenar)

@@ -494,2 +506,3 @@ * [random](#random)

<a name="restar" />

@@ -554,2 +567,58 @@ ### restar

<a name="purgeall" />
### purgeall
```js
purgeall()
```
Este metodo te permite eliminar todos los datos de una base de datos especifica.
__Argumentos__
Ninguno
__Retorna__
1. true si se elimino todo correctamente.
2. false si no se elimino correctamente.
__Ejemplos__
```js
const db = require('megadb');
let niveles = new db.crearDB('niveles');
//Estructura actual de la base de datos niveles.json:
{
"MegaStar": {
"nivel": 10
},
"MoDeR": {
"datos": {
"monedas": 200
}
},
"RatSageM": [],
"MGstar": {
"items": ["sandia"]
},
"Nelson": 5,
"Sun": {
"datos": {
"monedas": 0
}
}
}
let status = niveles.purgeall()
console.log(status) //Esto retorna true
//Estructura actual de la base de datos niveles.json:
{} //No contiene nada ya que se elimino todo
```
<a name="ordenar" />

@@ -1192,9 +1261,1 @@ ### ordenar

```
## Changelog
V1.5.0
* Se arreglo el readme.
V1.4.0
* Se arreglo un bug en la funcion obtener.
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