npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

best.db

v1.1.7

Published

It is a easy and quick storage unit that relies on `objects` to store data in **JSON** format

Downloads

213

Readme

What is best.db ?

  • It is a easy and quick storage

Installation

  • You need to install the package on your project
npm i best.db

Updates

  • Version (1.1.6) Added Some Features in Push and Pull Functions
  • Version (1.0.7, 1.0.8, 1.1.1, 1.1.4, 1.1.5, 1.1.7) => Fix Some Errors
  • Version (1.0.9) => Added Fetch
  • Version (1.1.2) => Change (.) To (..)
  • Version (1.1.3) => Fix Some Errors && Preventing mistakes from occurring

How To Use

[-] Set Function

  • Set Data if it is an object, string, number, array, or boolean
const db = require("best.db");

db.set(`key`, value); // To Set a Data
db.set(`key`, "This is Value"); // => true
db.set(`key..name`, "test"); // => key = { name: "test" };
db.set(`key..data`, "Hello World"); // => key = { name: "test", data: "Hello World" };
db.set(`key..number`, 0); // => key = { name: "test", data: "Hello World", number: 0 };
db.set(`key..array`, []); // => key = { name: "test", data: "Hello World", number: 0, array: [] };

[-] Get & Fetch Functions

  • To Get/Fetch The Data From Database(JSON) by key
db.get('key'); // To Get The Data By Key
db.get('key'); // => This is Value
db.get(`key..name`); // => test;

db.fetch('key'); // To fetch The Data By Key
db.fetch('key'); // => This is Value
db.fetch(`key..name`); // => test;

[-] Delete Function

  • To delete specific data or data from the database
db.delete('key'); // To Delete Data By Key
db.delete('key'); // => true
db.delete(`key..data`); // => key = { name: "test", number: 0, array: [] };

[-] Has Function

  • To verify whether this data exists or not ( return true or false )
db.has('key'); // To Get True Or False
db.has('key'); // => true
db.has(`key..name`); // => true
db.has(`key..data`); // => false

[-] Add Function

  • To Add a Number
db.add('key', value);
db.add('key', 5); // => key = 5;
db.add(`key..number`, 1); // => key = { name: "test", number: 1, array: [] };

[-] Subtract Function

  • To Subtract a Number
db.subtract('key', value);
db.subtract('key', 5); // key = 0
db.subtract('key..number', 1);  // => key = { name: "test", number: 0, array: [] };

[-] Push Function

  • To Push Element/s To Database
  • Merge: If you need to merge a array (Look To Examble)
db.push('key', value, merge=false);
db.push('key', "Push"); // key = ["Push"]
db.push('key', ["Push2", "Push3"], true) // key = ["Push", "Push2", "Push3"]
db.push('key..array', "Push 1"); // => key = { name: "test", number: 0, array: ["Push 1"] };
db.push('key..array', ["Push2", "Push3"], true) // key = { name: "test", number: 0, array: ["Push 1", "Push2", "Push3"] }

[-] Pull Function

  • To Pull Element/s from Database
  • arrayPull: If you need to Pull some data from array (Look To Examble)
db.pull('key', element, arrayPull=false); // To Pull Element/s From Data
db.pull('key', "Push"); // key = ["Push2", "Push3"]
db.pull('key', ["Push2", "Push3"], true) // key = []
db.pull('key..array', "Push 1"); // => key = { name: "test", number: 0, array: ["Push2", "Push3"] };
db.pull('key..array', ["Push2", "Push3"], true); // => key = { name: "test", number: 0, array: [] };

[-] All Function

  • All To Get All Database
db.all();
// Exmaple => [ { ID: `test`, data: `Hello World` } ]

[-] Backup & Reset Functions

  • Backup To Make a backup
  • Reset To Delete All Database
db.backup("Filename");
db.reset();

Developer