
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
This package is an NPM module that makes using JSON and Mongo fast, secure and easy. Developer: mete52
✨ Version 1.0.8
npm install metusbase
or
pnpm install metusbase
CommonJS:
const { Database, MongoDatabase } = require("metusbase");
const mongoose = require("mongoose");
ESM:
import { Database, MongoDatabase } from "metusbase";
import mongoose from "mongoose";
const db = new Database("path.json"); // not required
db.set("key.object1.object2", "value"); // result: { key: { object1: { object2: "value" } } }
db.add("key", "value"); // result: { key: { list: ["item"] } }
db.get("key"); // result: { object1: { object2: "value" } }
db.get("key.object1"); // result: { object2: "value" }
db.get("key.object1.object2"); // result: "value"
db.getAll(); // result: { key: { object1: { object2: "value" } } } => all keys
db.push("key.array", "value1"); // result: { key: { array: ["value1"] } }
db.push("key.array", "value2"); // result: { key: { array: ["value1", "value2"] } }
db.unpush("key.array", "value1"); // result: { key: { array: ["value2"] } }
db.unpush("key.array"); // result: { key: {} } removes the entire array
db.has("key.object1.object2"); // result: true
db.delete("key.object1.object2"); // result: { key: { object1: {} } }
db.delete("key.object1"); // result: { key: {} }
db.delete("key"); // result: {}
db.deleteAll(
"You are fully responsible for the data in your project. This data will be deleted. Do you confirm? (I confirm)"
); // result: {} => deletes all data in the database
const db = new MongoDatabase();
const mongo = "mongodburl";
(async () => {
await mongoose
.connect(mongo)
.then(() => {
console.log("Mongodb connection successful!");
})
.catch((e) => {
console.error(e);
});
})();
(async () => {
db.set("key", "mete52"); // result: {value: "mete52"}
db.set("key2", { name: "mete52", age: 21 }); // result: {"value": {name:"mete52",age:21}}
await db.get("key"); // result: mete52
await db.get("key2"); // result: {name:"mete52",age:21}
await db.getAll(); // result: {key:"mete52",key2:{name:"mete52",age:21}}
db.push("newKey", "value1"); // result: ["value1"]
db.unpush("newKey"); // result: []
db.unpush("newKey", "value1"); // result []
db.has("key"); // result: true
db.delete("key"); // result: {}
db.delete("key2"); // result: {}
db.deleteAll(
"Projenizdeki verilerden tamamen siz sorumlusunuz. Bu veriler silinecektir. Onaylıyor musunuz? (onaylıyorum)"
); // result: {} => deletes all data in the database
})();
All issues when using this npm package will be considered accepted by you, please act accordingly.
FAQs
This package is an NPM module that makes using JSON and Mongo fast, secure and easy. Developer: mete52
The npm package metusbase receives a total of 6 weekly downloads. As such, metusbase popularity was classified as not popular.
We found that metusbase demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.