Catalog npm
PACKAGE EXPLORERView in registry

83db

npm

Entirely encrypted and GZip compressed JSON Database

compressed-databasecompressed-dbdatabasedbencrypted-databaseencrypted-dbencrypted-json-databasejsonjson-databasejson-dbnodejs
Versions collected3
Direct dependencies0From release 1.0.2
Last observed20 Oct, 21:18 UTC

README

Current package documentation

Getting Started

83db is a CURD, GZip compressed, JSON database with optional AES-256-CBC encryption

Simple DB:


First, create a new JS file for your database, For this example I will make a file named `users.js` and a database file named `users.db`
const Database = require("83db");

module.exports.UserDB = new Database('./users.db', {
    dir: __dirname // This is needed for local paths
})

Encrypted DB:


Same steps as before, but add the `decryptionKey` option.
const Database = require("83db");

module.exports.UserDB = new Database('./users.db', {
    dir: __dirname, // This is needed for local paths
    decryptionKey: "256 bit ( 16 hex characters ) decryption key, store in env"
})

Functions


get(key: string)

  • Gets the value in a DB with the key, key
  • Returns the key's value

set(key: string, value: any)

  • Sets a key's value, or creates it if it doesnt exist.
  • Returns Database

delete(key: string)

  • Deletes the value with the key, key
  • Returns Database

list(prefix: string?)

  • List all keys with an optional prefix
  • Returns string[]

empty()

  • Empties the entire database
  • Returns Database

exists(key: string)

  • Checks if a key, key exists
  • Returns Boolean

write(encryptionKey : string?)

  • Writes all data to the file, you can override the encryption key with the optional encryptionKey parameter
  • Returns Database

getAll()

  • Returns an object with all the keys and values like { key: value ... }
  • Returns object

setAll(obj : object?)

  • Sets the database's JSON to a specified object obj
  • Returns Database

Examples


Creates a key named "John" and has a value of { lastName: "Doe" }

const Database = require("83db");

const users = new Database('./users.db', {
    dir: __dirname
});

users.set("John", {
    lastName: "Doe"
}).write();

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.2Registry latest21 Jul 20220
1.0.121 Jul 20220
1.0.021 Jul 20220

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:18 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:05c9e21b2307bc65510647ab9c79a5c152a8d38c2710a935ce8846da2bee1948