Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
NoSQL Database for node.js with all data loaded in ram and backup in json file
NoSQL Database for node.js with all data loaded in ram and backup in json file.
Here is a list of way to set and get the data
// Load the library
var RamliteDB = require('ramlitedb');
// instanciate the database
var rlDB = new RamliteDB({
backupFile: './dataBase.json'
});
// wait for database to be loaded
rlDB.on('load', () => {
// set a numerical value
rlDB.set('version', 1.5);
rlDB.get('version'); // (numeric) 1.5
// set a string value
rlDB.set('cake.name', 'Chocolator');
rlDB.get('cake.name'); // (string) "Chocolator"
rlDB.set('cake.sugar', '10 kg');
console.log(rlDB.get('cake.sugar')); // (string) "10 kg"
// set a boolean value
rlDB.set('cake.good', true);
console.log(rlDB.get('cake.good')); // (bool) true
// set an array
rlDB.set('cake.ingredients', [
"egg",
"sugar",
"chocolate",
"floor"
]);
console.log(rlDB.get('cake.ingredients')); // (array) [egg, ...]
// get a specific element from an array
console.log(rlDB.get('cake.ingredients.2')); // (string) "chocolate"
// set an object
rlDB.set('cake.description', {
title: "my cake",
author: "me the cooker"
});
console.log(rlDB.get('cake.description')); // (object) {title: ...}
// get element inside and object
console.log(rlDB.get('cake.description.title')); // (string) "my cake"
// Alternative syntax
console.log(rlDB.get(['cake', 'description', 'title'])); // (string) "my cake"
// get element anywhere in the database
console.log(rlDB.get('cake')); // (object) {"name":"Chocolator", "sugar": "10 kg", ...}
})
In the end you should have dataBase.json like this
{
"version": 1.5,
"cake": {
"name": "Chocolator",
"sugar": "10 kg",
"good": true,
"ingredients": [
"egg",
"sugar",
"chocolate",
"floor"
],
"description": {
"title": "my cake",
"author": "me the cooker"
}
}
}
Set a value
Get a value
Create an index. It's needed to make "getby" researchs. (researchs will be in O(1) complexity)
Get every objects located at key, having 'by' set to 'value'
Free all ressources (! this is asynchrone !)
Attach an action to a specific event (load, backup, unload)
Feel free to contribute and give feedbacks
FAQs
NoSQL Database for node.js with all data loaded in ram and backup in json file
The npm package ramlitedb receives a total of 0 weekly downloads. As such, ramlitedb popularity was classified as not popular.
We found that ramlitedb 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.