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

emo-db

v0.2.0

Published

JSON Based Database, Specifically For Normal Discord Bots

Downloads

21

Readme

Emo DB

  • JSON Based Database, Specifically For Normal Discord Bots

Example

const db = require("emo-db");
// GET Data Some How | You Need To Replace It With Your Data
const data = getDataSomeHow();

// Set Property | Key - String | Value - Any (Object, Array, String, ...)
db.set("John", data);
db.set("John-2", data);
db.set("Balance", data.balance);
db.set("Fruits", data.fruits);
db.set("Temporary-Data", data.temp);
// Delete Property | Key - String
db.remove("Temporary-Data");
// Fetch Property | Key - String | Alias - get
db.fetch("John");
db.get("John");
// Check If Property Exists | Key - String | Lodash GET - False
db.has("John");
// Add Value To Property | Key - String | Property Value Type - Number | Value - Number
db.add("Balance", 100);
// Subtract Value From Property | Key - String | Property Value Type - Number | Value - Number
db.subtract("Balance", 100);
// Push Element To Array-type Property | Key - String | Property Value Type - Array | Value - Any (Object, Array, String, ...)
db.push("Fruits", "Apple");
db.push("Fruits", "Banana", "Orange");
// Filter Specific Properties From Database | Func - Function | Type - Array (Default) Or Object
db.filter((element) => element.key.startsWith("John"));
db.filter((element) => element.key.startsWith("John"), "Object");
// Be Careful With value Property, It Can Be Any (Object, Array, String, ...) So Check Type Before Checking Anything
db.filter((element) => typeof element.value === "number");
db.filter((element) => typeof element.value === "number" && element.value === 0);
// GET All Properties From Database | Type - Array (Default) Or Object
db.all();
db.all("Object");
// Clear Database
db.clear();
// Destroy Database (Clear Database & Delete Database File)
db.destroy();

Why Emo DB?

  • Simple & Easy To Use
  • Small But Powerful
  • Discord Support
  • Want More? Use Private Functions

Private Functions

  • Please Use These Functions Carefully, Thanks
const db = require("emo-db");
const data = getDataSomeHow();

// Set Whole Database File Content Into Provided JSON Content
db.__set({});
// Read Whole Database File Content
db.__read();
// Delete Whole Database File (Content Too)
db.__delete();
// Throw An Error Using emo-db
db.__err("Fake Error Message From emo-db NPM Package");
// FS (File System) Package
db.fs.readFileSync(options);
db.fs.writeFileSync(options);
db.fs.unlinkSync(options);

Information

Note: I Didn't Created This Fully By Myself & It's NOT For Huge Projects