
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Anti-db takes the idea of a database fronted by a memory cache and reverses it, for maximum performance. The storage is a POJO (plain old JS object), which is saved to disk upon program exit. Optionally, the data can be saved to disk periodically.
###Initializing an object from disk
var antidb = require('anti-db')();
var myobj = antidb.obj('./some.json');
myobj.hey = 'there';
// no need to call save(), automatically saved to disk on exit ./some.json
var myarr = antidb.obj('./somearr.json', []);
myarr.push(1970);
var antidb = require('anti-db')(10000); // every 10 sec.
var myobj = antidb.obj('./some.json');
myobj.hey = 'there';
Will not attempt any saving to disk on SIGINT EXIT etc.., and just save to disk periodically.
var antidb = require('anti-db')(period = 10000, nosaveonexit = 1}); // every 10 sec.
var myobj = antidb.obj('./some.json');
myobj.hey = 'there';
var antidb = require('anti-db')();
var myobj = antidb.obj('./some.json', {name: 'Chris', age: 21});
// Using a CSV as backing file
var antidb = require('anti-db')();
antidb.loadFunc = function(name, type){
var csv_arr = fs.readFileSync(name).toString().split(/\n/);
// put into JSON object
return obj;
}
antidb.saveFunc = function(name, o){
require('json2csv')({data: json, fields: ['car', 'price', 'color']}, function(err, csv) {
if (err) console.log(err);
fs.writeFile('file.csv', csv, function(err) {
if (err) throw err;
console.log('file saved');
});
});
}
Do this when running your app..
$ debug=1 node myapp
FAQs
Plain old JS object that saves itself to disk
We found that anti-db 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.