Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
browser-stream-tar
Advanced tools
split tar web-stream into a sequence of Files
import { files } from "browser-stream-tar";
const response = await fetch("some tar file");
for await (const file of files(response.body)) {
console.log(file.name);
// do something with entry.stream()
}
Field Name Byte Offset Length in Bytes Field Type name 0 100 NUL-terminated if NUL fits mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 see below linkname 157 100 NUL-terminated if NUL fits magic 257 6 must be TMAGIC (NUL term.) version 263 2 must be TVERSION uname 265 32 NUL-terminated gname 297 32 NUL-terminated devmajor 329 8 devminor 337 8 prefix 345 155 NUL-terminated if NUL fits
Type: number
Decodes a PAX header
reader
ReadableStreamReader where to read frombuffer
Uint8Array header
Object to be filled with values form bufferReturns Promise<Uint8Array> buffer positioned after the consumed bytes
Decodes the next header.
reader
ReadableStreamReader<Uint8Array> where to read frombuffer
(Uint8Array | undefined) header
Object to be filled with values form buffer and readerReturns Promise<(Uint8Array | undefined)> buffer positioned after the consumed bytes
Provide tar entry iterator.
tar
ReadableStream Returns AsyncIterable<File>
--512--|-----512------| | R | O | | DDDDDDDDDDDD---------HHHH | | | A0 A0 A1
+--------- size --------+ | +- remaining -+- overflow -+ | | | | HDD ... DDDDDDDDDDDDDDDDDD------------HHHHHH [BUFFER .... ] [BUFFER ... ] +----------- skip --------+
Convert bytes into string.
bytes
Uint8Array Returns string
Convert ASCII octal number into number.
bytes
Uint8Array Returns number
Read bytes from a reader and append them to a given buffer until a requested length of the buffer is reached.
reader
ReadableStreamReader<Uint8Array> where to read frombuffer
Uint8Array? initial buffer or undefinedlength
number? desired buffer lengthReturns Promise<(Uint8Array | undefined)> filled up buffer
Skip some bytes from a buffer.
reader
ReadableStreamReader<Uint8Array> where to read frombuffer
Uint8Array length
number to be skippedReturns Promise<(Uint8Array | undefined)> buffer positionend after skipped bytes
Reads web stream content into a Uint8Array.
stream
ReadableStream Returns Promise<Uint8Array>
With npm do:
npm install browser-stream-tar
BSD-2-Clause
FAQs
split tar web-stream into a sequence of Files
The npm package browser-stream-tar receives a total of 35 weekly downloads. As such, browser-stream-tar popularity was classified as not popular.
We found that browser-stream-tar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.