Gathering detailed insights and metrics for croxydb-data
Gathering detailed insights and metrics for croxydb-data
npm install croxydb-data
Typescript
Module System
Node Version
NPM Version
32.1
Supply Chain
99
Quality
76.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
283
Last Day
1
Last Week
11
Last Month
21
Last Year
283
9 Stars
2 Commits
4 Forks
2 Watching
2 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
0.0.9
Package Id
croxydb-data@0.0.9
Unpacked Size
49.02 kB
Size
9.34 kB
File Count
20
NPM Version
6.14.12
Node Version
10.24.1
Publised On
09 Jun 2024
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
175%
11
Compared to previous week
Last month
-38.2%
21
Compared to previous month
Last year
0%
283
Compared to previous year
No dependencies detected.
a database module
Examples
Moving Data From Quick.DB
1const db = require("croxydb"); 2const quickdb = require("quick.db"); 3 4db.move(quickdb)
Normal Example
1const db = require("croxydb") 2 3db.set("x.y.z", "abc") // abc 4 5db.get("x") // {y: {z: "abc"}} 6db.fetch("x") // {y: {z: "abc"}} 7db.all() // {x: {y: {z: "abc"}}} 8 9db.push("a", "hello") // ["hello"] 10db.push("a", "world") // ["hello", "world"] 11db.unpush("a", "hello") // ["world"] 12 13db.push("b", {test: "croxydb"}) // [{test: "croxydb"}] 14db.push("b", {test2: "croxydb2"}) // [{test: "croxydb"}, {test2: "croxydb2"}] 15db.delByPriority("b", 1) // [{test2: "croxydb"}] 16db.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}] 17 18db.has("x") // true 19db.delete("x") // true 20db.deleteAll() // true
MongoDB Support (It is new feature, if you find any bugs join my Discord)
1const db = require("croxydb") 2db.setAdapter("mongo", 3{ 4 url: "Your Mongo URL", 5 schema: "Schema" 6}) 7 8db.set("x.y.z", "abc") // abc 9 10db.get("x") // {y: {z: "abc"}} 11db.fetch("x") // {y: {z: "abc"}} 12db.all() // {x: {y: {z: "abc"}}} 13 14db.push("a", "hello") // ["hello"] 15db.push("a", "world") // ["hello", "world"] 16db.unpush("a", "hello") // ["world"] 17 18db.push("b", {test: "croxydb"}) // [{test: "croxydb"}] 19db.push("b", {test2: "croxydb2"}) // [{test: "croxydb"}, {test2: "croxydb2"}] 20db.delByPriority("b", 1) // [{test2: "croxydb"}] 21db.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}] 22 23db.has("x") // true 24db.delete("x") // true 25db.deleteAll() // true
With Options Example
1const db = require("croxydb") 2db.setReadable(true) // It makes readable your JSON DB file. 3db.noBlankData(true) // If you delete anything from object and new object size is less than 1, automaticly removes that object. 4db.setAdapter("yamldb") // It makes adapter as YAML adapter. Default adapter is JsonDB 5db.setFolder("folder") // You can set database folder name 6db.setFile("db") // You can set database file name 7 8db.set("x.y.z", "abc") // abc 9 10db.get("x") // {y: {z: "abc"}} 11db.fetch("x") // {y: {z: "abc"}} 12db.all() // {x: {y: {z: "abc"}}} 13 14db.push("a", "hello") // ["hello"] 15db.push("a", "world") // ["hello", "world"] 16db.unpush("a", "hello") // ["world"] 17 18db.push("b", {test: "croxydb"}) // [{test: "croxydb"}] 19db.push("b", {test2: "croxydb2"}) // [{test: "croxydb"}, {test2: "croxydb2"}] 20db.delByPriority("b", 1) // [{test2: "croxydb"}] 21db.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}] 22 23db.has("x") // true 24db.delete("x") // true 25db.deleteAll() // true
If you've any question, you can join to my Discord server: Click me!
No vulnerabilities found.
No security vulnerabilities found.