
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Sagdb is JSON database system.
$ npm install sagdb
//JavaScript version
const Sagdb = require("sagdb").default;
//TypeScript version
import Sagdb from "sagdb";
Default database name is "db".
Db name and folder name is must be String.
Database folder name is optional.
If you want readable database, set "minify" to false.
const db = new Sagdb({ name: "database", folder: "foldername", minify: true });
const db = new Sagdb({ name: "database", folder: "folder/database" });
const db = new Sagdb({ name: "database" });
db.set("key", "apple"); // -> apple
Can't set Function.
function test() {}
db.set("key", test); // -> return Error
db.set("key", "apple"); // -> apple
db.get("key"); // -> apple
db.update("key", (old_data) => {
const new_data = old_data.toUpperCase();
return new_data;
});
db.set("key", "apple"); // -> apple
db.delete("key"); // -> apple
db.get("key"); // -> undefined
Add number to number value.
Value must be a Number.
Default number is 1.
db.set("number", 1); // -> 1
db.get("number"); // -> 1
db.add("number", 3); // -> 4
db.get("number"); // -> 4
db.add("number"); // -> 5
db.get("number"); // 5
db.add("number", "asd"); // return false
U can set object in object.
db.set("key.value", "apple"); // -> apple
db.get("key"); // -> { value : "apple" }
import Sagdb, { Table } from "sagdb";
const db = new Sagdb({ name: "database" });
const table = new Table(db, "table_name");
table.add(1); // -> {_id: "uuid", data: 1, createdAt: number, updatedAt: number}
table.find(callback | data_object); // -> {_id: "uuid", data: 1, createdAt: number, updatedAt: number} | undefined
table.findById("uuid"); // -> {_id: "uuid", data: 1, createdAt: number, updatedAt: number} | undefined
table.update(callback | data_object, new_data, force?: boolean); // -> {_id: "uuid", data: 1, createdAt: number, updatedAt: number} | undefined
table.filter(callback | data_object, new_data); // -> old_data: {_id: "uuid", data: 1, createdAt: number, updatedAt: number}[] | undefined
table.update(callback, all?: boolean); // -> {_id: "uuid", data: 1, createdAt: number, updatedAt: number} | undefined
table.on("event_name", callback()); // -> Listening.
Example
table.on("add", callback(new_data));
table.on("update", callback(old_data, new_data));
table.on("remove", callback(old_data));
License MIT
FAQs
Local json database.
The npm package sagdb receives a total of 10 weekly downloads. As such, sagdb popularity was classified as not popular.
We found that sagdb 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.