Catalog npm
Back to packageRELEASE DETAILS

1.0.2

npm

83db

Entirely encrypted and GZip compressed JSON Database

compressed-databasecompressed-dbdatabasedbencrypted-databaseencrypted-dbencrypted-json-databasejsonjson-databasejson-dbnodejs
Published21 Jul 2022
Direct dependencies0
Transitive dependenciesNot calculated

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.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-heKlfa4ZqGuPJwHpZdCiN0hW/HPMJhtkphVmEqWrJ4GdapgT8lEjZvhC7zJnhEBSk0sJL1s5U3LF8rpTieqTIg==",
  "shasum": "0e25cded5f2adf9ebcaef10abc3659b4a82e4f62",
  "tarball": "https://registry.npmjs.org/83db/-/83db-1.0.2.tgz",
  "fileCount": 3,
  "unpackedSize": 4723,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIB6AH15QXiWBDWiy7b3EJiUMNx7oaXIAREhD+XsRQjSSAiBmBAWzmr+rC9sTM+mMMd9BYC65LKoGPfDoaaIqnKcUow=="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2ZPpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhGw/9F2iGB48mPgKZghDueWCPFSc+i07tB0fJ9G9G3RO9Jjpdn4FE\r\n811+rVynlxLSdorazsJ3BJznZzNQ7k1an7+oaICe6H+4OH7fObuOjlBkpcuL\r\n4JcgT/UbY8anuo7GsAlFeGD6pecHFHv9wmUnsVJE3LE6b5aeSGKny1asFeD7\r\nmMMWoZnU1rhvikazpPItQPj9O8qto0XRV1bpa2MJuwjNiLYXvRuK+h5wKIyU\r\nXyhDizDrpqnE6Jj7GT8TdBD5oYutDtxTR8BPXUhnG3E4HfjlGHH5wNCEWW3+\r\nG1i4dZbuuIr87Vh4N0aTIW2T/Ao1+MPXuz7HOae42m0vWPEpoeqp6Ib4629j\r\nRZyYVQdLZ8ftrNrjhmjI88vTiOyr1mndxKdA9Cm2YyWOzA3xFYtzUKoH/yz2\r\nX+WZ9GS0DHFhNEsZ30CJ0LHfBPLXXzGgKO/BKLaYZqoKm7SNHRhBvVyb+TDz\r\nXkWiwrsFDOSQZo9qaHTI/tSqoC69ae7NcuTDrsEK8EA+Pe5qK/crTFJvK6rJ\r\nZCMG8n7o3ycGXWTdiQZsDomNPuGdJnqkaEG03DnUwJFzz1jz3SMb3GktHhif\r\ne2ClL8xc2GbFhi++mJb8nQK3bXdRtrRLyZEH2i6hhTc0Y6OoCXttJDd+l1Fl\r\nBbFHGKuQZ1MnXtabu5qNxDRUmHf/cUEe3Gk=\r\n=p3Bi\r\n-----END PGP SIGNATURE-----\r\n"
}

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_version:e09eee61a8d9d3d26c3216141e1e3eeda3b2a0c2dd697152628b4e833ebe9d1e

Other collected versions

1.0.121 Jul1.0.021 JulView all collected versions →