Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
block-reader
Advanced tools
Readme
read specific chunks of files by offset.
``js
var blockReader = require("block-reader")
blockReader("/somefile",1024,function(err,reader,fd,stat){
reader.read(0,function(err,buf){ console.log(buf,toString(),'this is bytes 0-1023 in from somefile'); })
reader.read(5,function(err,buf){
console.log(buf,toString(),'this is bytes 4095-5119 from somefile');
})
reader.read(100,function(err,buf){ // if the offset doesnt exist you should get an error. console.log(err) })
})
in some cases i already have a file descriptor and stat so i use ```fromFD```
```js
var blockReader = require("block-reader")
var stat = ..
var fd = ..
var reader = blockReader.fromFD(fd,stat.size,1024)
reader.read(0,function(err,buf){
console.log(buf,toString(),'this is bytes 0-1023 in from somefile');
})
you may change the size of the file but you shouldn't need to create a new reader. if you want to access those offsets the reader will need to know the new size.
fs.stat('/somefile',function(err,stat){
reader.size(stat.size);
});
FAQs
read specific chunks of files by offset
The npm package block-reader receives a total of 0 weekly downloads. As such, block-reader popularity was classified as not popular.
We found that block-reader 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.