Socket
Socket
Sign inDemoInstall

bookman

Package Overview
Dependencies
234
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bookman

BookmanDB is a very easy to use and easily editable database module that allows you to create unlimited amount of unique database files and database childs! BookmanDB also saves your data in a json file so you can access and edit


Version published
Weekly downloads
104
decreased by-0.95%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

BookmanDB: An Easy-To-Use Database

BookmanDB is a very easy to use and easily editable database module that allows you to create unlimited amount of unique database files and database childs!

BookmanDB also saves your data in a json file so you can access and edit simple files at any time.

Discord: https://discord.com/invite/BjEJFwh

NPM Page GITHUB Page

Usage

Here is a simple but effective example!

/* BookmanDB Files */
const { Database } = require("bookman");
/* Creating New Database */
const db = new Database("DatabaseName");

/* Setting a value in the database */
db.set("just.a.long.data.name", "Bookman is cool!"); // => "Bookman is cool!"
db.set("just.a.long.array", []); // => []
db.set("just.a.long.number", 1); // => 1

/* Getting a value in the database */
db.get("just.a.long.data"); // => { name: "Bookman is cool!" }
db.fetch("just.a.long.number"); // => 1

/* Check if data created */
db.has("just.a.long"); // => true
db.has("just.a.long.name"); // => false

/* Add specified data */
db.add("just.a.long.number", 1); // => 2
db.add("just.a.long.number", 5); // => 7

/* Subtract specified data */
db.subtract("just.a.long.number", 1); // => 6
db.subtract("just.a.long.number", 3); // => 3

/* Push specified data */
db.push("just.a.long.array", 2); // => [2]
db.push("just.a.long.array", null); // => [2, null, 3, "str1", {}]
db.push("just.a.long.array", 3); // => [2, null, 3]
db.push("just.a.long.array", "str1"); // => [2, null, 3, "str1"]
db.push("just.a.long.array", {}); // => [2, null, 3, "str1", {}]

/* Pop specified data */
db.pop("just.a.long.array"); // => [2, null, 3, "str1"]

/* Shift specified data */
db.shift("just.a.long.array"); // => [null, 3, "str1"]

/* Unshift specified data */
db.unshift("just.a.long.array", 5); // => [5, null, 3, "str1"]

/* Mapping data */
db.map(); // =>  { just: { a: { long: [Object] } } }

/* Deleting a value in the database */
db.delete("just.a.long"); // => { just: { a: { long: [Object] } } } has been deleted

/* Destroying database */
db.destroy(); // true

It looks so scary right :D Don't worry you dont have to know all of these xd

Contact Me For More Help

\ ゜ o ゜)ノ

Keywords

FAQs

Last updated on 21 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc