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.
path-source
Advanced tools
Read files in Node, or fetch URLs in browser, as standard WhatWG streams.
A readable stream reader for reading files in Node or fetching URLs in browser. For example, to read a file in Node:
var path = require("path-source");
path("README.md")
.then(function read(source) {
return source.read().then(result => {
if (result.done) return;
process.stdout.write(result.value);
return read(source);
});
})
.catch(error => console.error(error.stack));
Similarly, to fetch a resource in a browser (requires array-source if streaming fetch is not supported):
<!DOCTYPE html>
<script src="https://unpkg.com/array-source@0"></script>
<script src="https://unpkg.com/path-source@0"></script>
<script>
sources.path("README.md")
.then(function read(source) {
return source.read().then(result => {
if (result.done) return;
console.log(result.value);
return read(source);
});
})
.catch(error => console.error(error.stack));
</script>
In Node, returns a Promise that yields a source for the file at the specified path; equivalent to file-source. In a browser, returns a Promise that yields a source for the resource at the specified path URL, using streaming fetch if available, and falling back to a binary data XMLHttpRequest.
In Node, the following options are supported:
highWaterMark
- the stream’s internal buffer size; defaults to 65,536In a browser, no options are currently supported.
Returns a Promise for the next chunk of data from the underlying stream. The yielded result is an object with the following properties:
value
- a Uint8Array (a Buffer), or undefined if the stream endeddone
- a boolean which is true if the stream endedReturns a Promise which is resolved when the underlying stream has been destroyed.
FAQs
Read files in Node, or fetch URLs in browser, as standard WhatWG streams.
The npm package path-source receives a total of 89,587 weekly downloads. As such, path-source popularity was classified as popular.
We found that path-source 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.