
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
LOG-based JavaScript DataBase (based on streaming processing). The API will be significantly changed.
npm i docdb --save
const DATASTORE = require('docdb');
let DataBase = new DATASTORE({dbname:'_test'});
DataBase.then(function(db){
//warning stream
db.on('data', function(buffer){
console.log(buffer);
});
//find documents from database (if you use the _id key, the search is performed by index)
db.findMany({..filter documents fields type of Object}, [..document fields returned type of Array]).then(function(arr){
//query result type of Array
console.log(arr);
});
//insert (or update if exists) one document from database
db.insertOne({..insert document type of Object}).then(function(_id){
console.log(arr);
});
//remove one document from database
db.removeOne({_id: first key document type of String}).then(function(_id){
console.log(arr);
});
//backup database files
db.service.toBackup().then(function(){
});
//restore database files from backup
db.service.fromBackup().then(function(){
});
//recovery index file
db.service.recovery().then(function(){
});
//index file compression
db.service.compact().then(function(){
});
//data file compression
db.service.compact("log").then(function(){
});
});
const DATASTORE = require('docdb');
let DataBase = new DATASTORE({dbname:'test'});
DataBase.then(function(db){
//warning stream
db.on('data', function(buffer){
console.log(buffer);
});
//insert (or update if exists) one document from database
db.insertOne({_id: "sdasdasdas", text:"test", data: Date.now()}).then(function(_id){
console.log(_id);
return new Promise(function(res, rej){ //find documents from database (if you use the _id key, the search is performed by index)
setTimeout(function(){
db.findMany({_id: "sdasdasdas"}, ["_id", "text"]).then(res).catch(rej);
}, 100);
});
}).then(function(arr){
//query result
console.log(arr);
return db.removeOne({_id: "sdasdasdas"}); //remove one document from database
}).then(function(_id){
console.log(_id);
return new Promise(function(res, rej){ //find documents from database (if you use the _id key, the search is performed by index)
setTimeout(function(){
db.findMany({_id: "sdasdasdas"}, ["_id", "text"]).then(res).catch(rej);
}, 100);
});
}).then(function(arr){
console.log(arr);
return db.service.toBackup();//backup database files
}).then(function(bool){
console.log(bool);
return db.service.fromBackup();//restore database files from backup
}).then(function(bool){
console.log(bool);
return db.service.recovery();//recovery index file
}).then(function(bool){
console.log(bool);
return db.service.compact();//index file compression
}).then(function(){
return db.service.compact("log");//data file compression
}).then(function(){
console.log('Test complete!');
}).catch(function(err){
console.log('Test interrupted, with error:', err);
});
});
let READLINE = require('readline'),
DATASTORE = require('docdb');
let DataBase = new DATASTORE({dbname:'test'});
DataBase.then(function(db){
db.on('data', function(buffer){
console.log(buffer);
});
const rl = READLINE.createInterface({
input: process.stdin,
output: process.stdout,
prompt: 'DocDB> '
});
rl.prompt();
rl.on('line', (line) => {
try{
let _tmp = eval(line);
if(typeof(_tmp) !== 'undefined'){
console.log(_tmp);
}
} catch(err) {
console.error("Ошибка команды: "+err);
}
rl.prompt();
}).on('close', () => {
console.log('DocDB disconnected!');
process.exit(0);
});
});
Apache-2.0
FAQs
crossplatform NoSQL JS database
We found that docdb 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.