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.
fs-minipass
Advanced tools
Changelog
Readme
Filesystem streams based on minipass.
4 classes are exported:
When using ReadStreamSync
, all of the data is made available
immediately upon consuming the stream. Nothing is buffered in memory
when the stream is constructed. If the stream is piped to a writer,
then it will synchronously read()
and emit data into the writer as
fast as the writer can consume it. (That is, it will respect
backpressure.) If you call stream.read()
then it will read the
entire file and return the contents.
When using WriteStreamSync
, every write is flushed to the file
synchronously. If your writes all come in a single tick, then it'll
write it all out in a single tick. It's as synchronous as you are.
The async versions work much like their node builtin counterparts, with the exception of introducing significantly less Stream machinery overhead.
It's just streams, you pipe them or read() them or write() to them.
const fsm = require('fs-minipass')
const readStream = new fsm.ReadStream('file.txt')
const writeStream = new fsm.WriteStream('output.txt')
writeStream.write('some file header or whatever\n')
readStream.pipe(writeStream)
Path string is required, but somewhat irrelevant if an open file descriptor is passed in as an option.
Options:
fd
Pass in a numeric file descriptor, if the file is already open.readSize
The size of reads to do, defaults to 16MBsize
The size of the file, if known. Prevents zero-byte read()
call at the end.autoClose
Set to false
to prevent the file descriptor from being
closed when the file is done being read.Path string is required, but somewhat irrelevant if an open file descriptor is passed in as an option.
Options:
fd
Pass in a numeric file descriptor, if the file is already open.mode
The mode to create the file with. Defaults to 0o666
.start
The position in the file to start reading. If not
specified, then the file will start writing at position zero, and be
truncated by default.autoClose
Set to false
to prevent the file descriptor from being
closed when the stream is ended.flags
Flags to use when opening the file. Irrelevant if fd
is
passed in, since file won't be opened in that case. Defaults to
'a'
if a pos
is specified, or 'w'
otherwise.FAQs
fs read and write streams based on minipass
The npm package fs-minipass receives a total of 26,183,727 weekly downloads. As such, fs-minipass popularity was classified as popular.
We found that fs-minipass demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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.