Gathering detailed insights and metrics for ervel.db
Gathering detailed insights and metrics for ervel.db
Local and Cloud data storage module. (JSON, BSON, YAML, Mongodb)
npm install ervel.db
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
10,033
Last Day
3
Last Week
14
Last Month
54
Last Year
2,818
3 Stars
12 Commits
1 Watching
1 Branches
1 Contributors
Latest Version
3.6.1
Package Id
ervel.db@3.6.1
Unpacked Size
85.23 kB
Size
16.05 kB
File Count
12
NPM Version
8.11.0
Node Version
17.9.1
Publised On
27 Sept 2024
Cumulative downloads
Total Downloads
Last day
-40%
3
Compared to previous day
Last week
-26.3%
14
Compared to previous week
Last month
-76.9%
54
Compared to previous month
Last year
-30.4%
2,818
Compared to previous year
• Added separator support to the "includes", "startsWith", and "endsWith" functions, along with improvements to the "includesDelete" function for better key deletion efficiency.
• A new option has been added to local providers. When the "deleteEmptyObjects" option is enabled, any empty objects will be automatically removed after a deletion, ensuring cleaner data management.
• 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.
1const { YamlProvider, BsonProvider, JsonProvider } = require("ervel.db")
1const db = new JsonProvider({}) // Every options is set to default. 2 3const db = new JsonProvider({ // Alternatives, new YamlProvider({ and new BsonProvider({ 4 5path: "./files/advanceduser.json", // Optional, specify the path 6separator: "*", // Optional, change separator 7useEmit: true, // Optional, enable EventEmitter functions 8checkUpdate: false, // Optional, disable module update checks 9minify: true, // Optional, change database format 10deleteEmptyObjects: true // Optional, enable Delete Empty Objects 11 12});
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")
: Lists data entries whose keys start with the keyword "key". [ keyanime: "value" ]
db.endsWith("key")
: Lists data entries whose keys end with the keyword "key". [ animekey: "value" ]
db.includes("key")
: Lists data entries that include the keyword "key". [ animekey: "value", keyanime: "value" ]
db.delete("key")
: Deletes the "key" data.
db.includesDelete("key")
: Deletes all entries from the database that contain the specified "key".
db.clear()
: Deletes all data in the database.
db.backup()
: Creates the ervel-backup.json file.
db.backup("./backup/file")
: Creates a backup file named "file" in the "./backup" directory.
db.backup("./backup/file", "1m")
: Automatically creates and updates a backup file named "file" in the "./backup" directory every 1 minute. 1s, 1m ,1h
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.6.1
1const { JsonProvider } = require("ervel.db") 2const db = new JsonProvider({}) 3 4const { QuickDB } = require("quick.db"); 5const quick = new QuickDB(); 6 7db.move(quick)
1const { MongoProvider } = require("ervel.db")
1const db = new MongoProvider("mongodb://localhost/ervel.db"); // Online database link or local database link
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.6.1
1const { MongoProvider } = require("ervel.db"); 2const db = new MongoProvider("mongodb://localhost/ervel.db"); 3 4const { QuickDB } = require("quick.db"); 5const quick = new QuickDB(); 6 7db.move(quick)
1const { JsonProvider } = require("ervel.db") 2const db = new JsonProvider({ useEmit: true }) 3 4db.on('set', ({ key, value }) => { 5console.log(`key: ${key} value: ${value}`); 6}); 7 8db.set("test", "test")
Ervel.db by Ervel is licensed under CC BY-NC-ND 4.0
Do you have a suggestion or complaint? Feel free to reach me on Discord with the nickname Ervel
No vulnerabilities found.
No security vulnerabilities found.