Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
chunk-store-read-stream
Advanced tools
chunk-store-read-stream allows for a chunk-store to be read as a nodejs Readable stream. Only a portion of the chunk-store can be ready by supplying the start
and end
options, and the chunk-store can be read while it's not fully populated by supplying the onmiss
option.
var Stream = require('chunk-store-read-stream')
var chunkStore // = some chunk store
stream.on('data', console.log)
Start or end at specified byte indexes of the chunk store
var stream = new Stream(chunkStore, {
start: 1, // Start reading at byte index 1 of the chunk store
end: 10 // End after reading the byte at index 10
})
Read a chunk-store that is missing some chunks
var stream = new Stream(chunkStore, { onmiss: onmiss })
function onmiss(err, index, retry) {
// An error occured while retreiving a chunk at `index`
// When a chunk is missing, an error is produced.
// ... some time passes and we know the chunk exists now ...
retry()
}
var stream = new Stream(chunkStore, [opts])
Instantiates a new nodejs Readable stream for the given chunkStore
. The opts
argument will be passed into the Readable Stream's options argument. It can also have the following properties:
opts.start
- The inclusive byte index to start reading atopts.end
- The inclusive byte index to stop reading atopts.onmiss
- The function to call to handle chunk missesIf opts.end
is not given then chunkStore.length - 1
is used instead. One of these properties must be defined.
opts.onmiss = function (err, index, retry) {}
err
is the error that was generated from retreiving the chunk at index
. The chunk-store interface does not distinguish between errors that occured because the chunk is simply missing or because something worse happend.
Once you know that the chunk does exist, you can call retry()
. If an error does occure, this can be passed into retry like retry(err)
.
MIT. Copyright (c) Austin Middleton.
FAQs
Read an abstract-chunk-store as a stream
The npm package chunk-store-read-stream receives a total of 1 weekly downloads. As such, chunk-store-read-stream popularity was classified as not popular.
We found that chunk-store-read-stream 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.