
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Hello, welcome to the documentation of jDB Net. This module is focused on making an efficient database with real time connection.
| Area | Quick Description |
|---|---|
| Introduction | Have a basic Idea of the module. |
| Structure | Have an idea of how the database looks. |
| Getting Started | Get started using the module. |
| Server Set-up | How to set-up the Server. |
| Client Set-up | How to set-up the Client. |
| Usage | How to use the Module. |
| Examples | Examples using this Module. |
This module have two sides. The server side that will hold the database, listen and validate requests. and the client side that will send requests to get, add, or delete data. There are permissions based on keys the server makes (or you). This permissions include read (Read the data), write (Add items, change their value), and manage (Delete whole rows and add news). And you can use the same computer as a server and client.
"collection": {
"item": "value"
}
Structure the JSON code below is a valid in this database. There are collections. Inside those collections there are items that cointains values.
collection => item => your info
// Example can Be
user => yaxeldragon => subscription => premium
// It supports JSON so you can add as much as you want.
Is fine if you don't get this now. In the practice you will understand it more.
To start using this database type the following in your console
npm install jdb_net
Wait until installed. Then import the module in your project by typing the following in your project
const jDB_Net = require('jdb_net');
To set up the server is very easy. First construct the client like this
// Imports
const jDB_Net = require('jdb_net');
// Set-up the Server
const server = new jDB_Net.server({
verbose: true, // Shows ALL Activity. (optional) (default: false)
});
Note : The JSON inside the constructor is totally optional. doing
new jDB_Net.server();would work, and have default values.
Then make the server listen for requests like this
server.listen(8080); // 8080: Is the PORT
Once you run this code it will give you a LOGIN KEY with default read: true, write: true, manage: false. You can make more going to etc/keys.json file and following the template.
Note : Make sure you have
READ, andWRITE, and theIPof the machine you are running the server on.
To set up the client it is slightly more complicated, and you need the IP, of server, and PORT, and LOGIN KEY. In this example the IP will be 127.0.0.1, the port will be 8080, and the key will be jdb (Not Recommended)
First construct the client like this
// Imports
const jDB_Net = require('jdb_net');
// Set-up the Client
const client = new jDB_Net.client('127.0.0.1:8080', 'jdb', {
verbose: false // Shows ALL Activity. (optional) (default: false)
});
Note : The JSON inside the constructor is totally optional. doing
new jDB_Net.client('127.0.0.1:8080', 'jdb');would work, and have default values.
Then connect by doing
client.connect().then(() => {
// All your code here.
// (jDB is made so it waits for the server to connect to execute this.)
[ ... ]
});
Command Action client.createCollection('collection'); Creates a Collection. client.collectionExists('collection'); Checks if a collection Exists. client.createItem('collection', 'item/s'); Creates an Item inside a Collection. client.fetch('collection'); Returns items inside a Collection. client.setItem('collection', 'item', 'value/s') Sets a value to an existing Item.
client.connect().then(() => { // Connect
client.createCollection('collection'); // Create Collection
});
Simply creates a new Collection.
client.connect().then(() => { // Connect
client.collectionExists('collection').then(exists => {
if ( exists == true ){
console.log('Collection Exists') // Logs "Collection Exists"
} else {
console.log('Collection Doesn\'t Exists') // Logs "Collection Doesn't Exists"
}
});
});
Checks if a collection Exists
client.connect().then(() => { // Connect
client.createItem('collection', 'item'); // Add a single Item
// OR
client.createItem('collection', ['item', 'itemB]'); // Add multiple Items
});
Adds an item inside a collection.
client.connect().then(() => { // Connect
client.fetch('collection').then(data => {
console.log(data);
// If there are ITEMS you can do :
console.log(data.item);
});
});
Looks for all items inside a collection and return it as JSON
client.connect().then(() => { // Connect
client.setItem('collection', 'item', 'value');
// OR to expand more the Possibilities
client.setItem('collection', 'item', {
subitem: 'another value, Wow!'
});
});
Set a value to an existing item. (It creates It as well)
Creating and Displaying Data
client.connect().then(() => {
client.collectionExists('users').then(exists => { // Checks if Collection Exists
if (exists == true) { // ---------------------------
client.createItem('users', '001'); // Create Items '001' Item in 'users' collection.
client.setItem('users', '001', { // Set values to '001' item in 'users' collection.
plan: 'premium', // | This value
expires: '12/12/2012' // |_ And this value
}); // ---------------------------
client.fetch('users').then((users) => { // Fetch all items in 'users' Collection.
console.log(users['001'].plan); // Logs "premium"
});
}
});
});
FAQs
A powerful JSON database with server and client Side.
We found that jdb_net 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.