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

ervel.db

v3.1.0

Published

Local and Cloud data storage module. (JSON, BSON, YAML, Mongodb)

Downloads

211

Readme

Typing SVG

Downloads DownloadPerMonth Version

Updates

  • Ervel.db local providers now automaticly checks updates for you. If you want to disable this feature you must add checkUpdate: false to any Local Provider that you use.
const { JsonProvider } = require("ervel.db")
const db = new JsonProvider({ checkUpdate: false })
  • Ervel.db local providers has been updated. Now you can use ervel.db easy than before. If you want to change or use features like seperator, path, checkUpdate or useEmit just provide that. If you do not provide any of that it will be auto switch to default for you.
const db = new JsonProvider({}) //Every options is set to default.
const db = new JsonProvider({ path: "./files/advanceduser.json", seperator: "*", useEmit: true, checkUpdate: false }) //Every options has been changed to user choice.

EventEmitter Usage Example

const { JsonProvider } = require("ervel.db")
const db = new JsonProvider({ useEmit: true })

db.on('set', ({ key, value }) => {
console.log(`key: ${key} value: ${value}`);
});

db.set("test", "test")

About

• Ervel.db is a beginner-friendly module that caters to new developers and allows easy usage of databases with a simple key-value structure. It encompasses popular database modules such as Mongodb, Bson, Yaml, and Json. In the future, it will be enriched with support for additional database types.

Features

  • Beginner friendly, All In One and Easy to use.
  • Personalizable seperator in JSON, BSON and YAML databases.
  • Key and Value based methods.
  • Quick to respond, read and write.
  • Mongo Multiple model support.
  • Easy to switch between JSON, BSON, YAML and Mongodb databases.
  • Supports EventEmitter functions in JSON, BSON and YAML databases.
  • Auto database typo fixer in JSON, BSON and YAML databases.
  • Auto Update Checker.

All Local Provider Methods

const { YamlProvider, BsonProvider, JsonProvider } = require("ervel.db")
const db = new YamlProvider({ path: "./ervel.yaml" }) //The file name, file location and seperator can be personalizable. Default seperator is ".".
const db = new BsonProvider({ path: "./ervel.bson" }) 
const db = new JsonProvider({ path: "./ervel.json" }) 

db.set("key", "value") //key: "value"

db.fetch("key") //"value"

db.get("key") //"value"

db.has("key") //true

db.push("array", "data") //array: ["data"]

db.pull("array", "data") //array: []

db.fetchAll() //{ key: "value", array: [] }

db.all() // { key: "value", array: [] }
db.all("object") //[ [key: "value"], [array: []] ]
db.all("keys") //["key", "array"]
db.all("values") //["value", []]

db.length() //Shows the number of data in the database.
db.length("key") //Shows the number of data in the "key" data.

db.type("key") //string

db.startsWith("key") //keyanime: "value"

db.endsWith("key") //animekey: "value"

db.includes("key") //animekeyanime: "value"

db.delete("key") //Deletes the "key" data.

db.clear() //Deletes all data in the database.

db.backup("filename") //Backups the database and creates "filename" backup file.

db.move(quick) //Moves Quick.db data to Local Provider.

db.add("number", 1) //number: 2

db.sub("number", 1) //number: 0

db.destroy() //Deletes the database file.

db.size() //Shows database size.

db.version() //3.1.0

All Mongo Methods

const { MongoProvider } = require("ervel.db");
const db = new MongoProvider("mongodb://localhost/ervel.db");

db.set("key", "value") //key: "value"

db.fetch("key") //"value"

db.get("key") //"value"

db.has("key") //true

db.push("array", "data") //array: ["data"]

db.pull("array", "data") //array: []

db.fetchAll() //{ key: "value", array: [] }

db.all() //{ key: "value", array: [] }

db.export() //Exports all data from the database.

db.import() //Imports all data from the database.

db.type("key") //string

db.uptime() //Shows connection uptime.

db.connection() //Shows connection status.

db.keyArray() //["key", "array"]

db.valueArray() //["value", []]

db.delete("key") //Deletes the "key" data.

db.clear() //Deletes all data in the database.

db.add("number", 1) //number: 2

db.sub("number", 1) //number: 0

db.move(quick) //Moves Quick.db data to Mongodb database.

db.disconnect() //Disconnects database connection.

db.createModel("name") //Creates model.

db.updateModel("name") //Updates the model name.

db.version() //3.1.0

Moving Data From Quick.DB to Mongodb

const { MongoProvider } = require("ervel.db");
const db = new MongoProvider("mongodb://localhost/ervel.db");

const { QuickDB } = require("quick.db");
const quick = new QuickDB();

db.move(quick)   

Moving Data From Quick.DB to Local Database

const { YamlProvider, BsonProvider, JsonProvider } = require("ervel.db")
const db = new YamlProvider({ path: "./ervel.yaml" })  //The file name, file location and seperator can be personalizable. Default seperator is ".".

const { QuickDB } = require("quick.db");
const quick = new QuickDB();

db.move(quick)