Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
buffered-sink
Advanced tools
A general purpose buffer class that can buffer custom objects need to be sent to a sink.
A general purpose Nodejs class that can be used to write data to any data sinks, with buffering. It's working is similar to underscore.js 's after() funnction. But it take care of some other situations too.
var BufferedSink = require('buffered-sink');
var jsonFileSink = new BufferedSink( {
maxSize: 5,
writeItems: function(items, cb){
var existing;
try {
existing = JSON.parse( fs.readFileSync( outFile, 'utf-8' ) );
} catch(e){
existing = [];
}
var total = existing.concat( items );
fs.writeFile( outFile, JSON.stringify(total, null, ' '), 'utf-8', cb );
}
});
jsonFileSink.$write({ title: 'first'}, cb ); // No real write. data is stored in memmoy
jsonFileSink.$write({ title: 'second'}, cb ); // No real write. data is stored in memmoy
jsonFileSink.$write({ title: 'third'}, cb ); // No real write. data is stored in memmoy
jsonFileSink.$write({ title: 'fourth'}, cb ); // No real write. data is stored in memmoy
jsonFileSink.$write({ title: 'fifth'}, cb ); // real write occurs. calls writeItems funnction provided in constructor internally.
opts.maxSize
: {Integer} maximum size of internal buffer.opts.writeItems
: {funnction( items, callback )} A function that does real writing.$writeItems( items, cb )
Writes an array of items.
$write( items, cb )
Writes a single item.
flush( cb )
Do real writing and empty the buffer.
Used to store items. Used as a buffer store.
Used to store items at the moment when real writing is taking place. To be precise, if this.isWriting == true.
A flag that used to indicate whether real writing is taking place or not.
FAQs
A general purpose buffer class that can buffer custom objects need to be sent to a sink.
The npm package buffered-sink receives a total of 0 weekly downloads. As such, buffered-sink popularity was classified as not popular.
We found that buffered-sink 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.