Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
dbdjs.db
Advanced tools
Readme
dbdjs.db is a JSON Database meant for quick and easy saving data values.
const DBDJSDB = require("dbdjs.db");
const db = new DBDJSDB.Database({
path: "database",
tables: {{
name: "test",
}},
});
db.once("ready", () => {
console.log("Database ready!");
});
db.connect();
await db.set("test", "apple", "turtle.");
await db.set("test", "leref", "dbdjs.db owner");
const apple = await db.get("test", "apple");
const leref = await db.get("test", "leref");
const lerefAndApple = await db.all("test", {
filter: ({ data }) => data.key.includes("w"),
});
await db.delete("test", "apple");
await db.delete("test", "leref");
Params | Description |
---|---|
options: DatabaseOptions | The database constructor to make a new database instance. |
Params | Return | Description |
---|---|---|
table: string, key: string, value: any | Promise<boolean> | Set method for the database. |
Params | Return | Description |
---|---|---|
table: string, key: string | Promise<Data> | Get method for the database. |
Params | Return | Description |
---|---|---|
table: string, options: AllOptions | Promise<AllData[]> | GetAll method for the database. |
Params | Return | Description |
---|---|---|
table: string, key: string | Promise<boolean> | Delete method for the database. |
Property | Value | Default | Description |
---|---|---|---|
tables | Table[] | The reserved tables for the database. | |
path? | string | "database" | Path to main database folder. |
maxFileData? | number | 50000 | The max data that a file can store. |
debug? | boolean | false | Whether the database should send debug log events. |
extension? | string | ".sql" | The extension for each file in the database. |
force? | boolean | false | Whether to force the database to save or delete data on the file. |
cache? | number | 3000 | How many data can the database store in memory cache. |
timestamp? | boolean | false | Whether the database should save timestamp for each data. |
saveTime? | number | 100 | How long until the database can save the data into file (ms). |
getTime? | number | 1 | How long until the database pull a data from file (ms). |
allTime? | number | 100 | How long until the database pull some data from file (ms). |
deleteTime? | number | 100 | How long until the database delete a data from file (ms). |
cacheRouters? | boolean | true | Whether the database should cache data routers on startup. |
Property | Value | Description |
---|---|---|
name | string | Name for the table, this will also define the path to this table file. |
Property | Value | Description |
---|---|---|
key | string | The key of the data. |
value | any | The value of the data. |
ttl? | number | The ttl for the data. |
createdAt? | number | The time which this data was created. |
updatedAt? | number | The time which this data was last updated. |
Property | Value | Description |
---|---|---|
filter | (allData: AllData) => boolean | The function to filters data. |
Property | Value | Description |
---|---|---|
key | string | The key of the data. |
data | Data | The data object of the data. |
dbdjs.db was created for dbd.js now available for anyone to learn and use.
FAQs
dbdjs.db - JSON Database with Speed and Optimization.
The npm package dbdjs.db receives a total of 1,071 weekly downloads. As such, dbdjs.db popularity was classified as popular.
We found that dbdjs.db demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.