Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Buffers entries from a tar.Parse() stream into memory.
var fs = require('fs');
var zlib = require('zlib');
var tar = require('tar');
var TarBuffer = require('tar-buffer');
var parser = tar.Parse();
var buffer = new TarBuffer(parser)
.on('error', function (err) { console.log ('tar error: %s', err); })
.on('end', function () {
//
// Log all our files in memory
//
console.dir(buffer.files);
});
//
// Read our tarball and pipe it to the tar parser.
//
fs.createReadStream('any-tarball.tgz')
.pipe(zlib.Unzip())
.on('error', function (err) { console.log('zlib error: %s', err); })
.pipe(parser);
log
: (optional) Log function to use. Expects console.log
API.ignore
: (optional) Array (or /\r?\n/
delimted string) of ignorefile lines.strip
: (optional) Number of preceding segments of an entry path to strip.maxSize
: (optional) Maximum number of bytes in a single file to buffer.entry
: similar the entry
events emitted by the tar.Parse()
stream except that these entries have been fully read into memory. The contents are located on e.content
:var buffer = new TarBuffer(parser)
.on('entry', function (e) {
console.log(e.content); // Log all file contents
});
Underneath the covers, tar
emits several events, not just data
events which have to be handled seprately from a traditional stream.
FAQs
Buffers entries from a tar.Parse() stream into memory
The npm package tar-buffer receives a total of 9,255 weekly downloads. As such, tar-buffer popularity was classified as popular.
We found that tar-buffer 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.