Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
readline-transform
Advanced tools
Reading String or Buffer content from a Readable stream and writing each line which ends without line break as object
$ npm install -save readline-transform
new ReadlineTransform(options)
options
<Object>
breakMatcher
is the regular expression to split content by line break for str.split()
. (default: /\r?\n/
)ignoreEndOfBreak
is boolean. if content ends with line break, ignore last empty line. (default: true
)skipEmpty
is boolean. if line is empty string, skip it (default: false
)const { PassThrough } = require('stream');
const ReadlineTransform = require('readline-transform');
const readStream = new PassThrough();
const transform = new ReadlineTransform({ skipEmpty: true });
const writeStream = new PassThrough({ objectMode: true });
writeStream.on('data', (line) => {
console.log(line);
}).on('finish', () => {
console.log('<<< all done >>>');
});
readStream.pipe(transform).pipe(writeStream);
readStream.write(new Buffer('foo\nba'));
readStream.write(new Buffer('r\r\n\n\r'));
readStream.end(new Buffer('\nbaz'));
$ node example.js
foo
bar
baz
<<< all done >>>
FAQs
Transform stream to read line-by-line and write a string
We found that readline-transform 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.