Gathering detailed insights and metrics for blob-slicer
Gathering detailed insights and metrics for blob-slicer
Gathering detailed insights and metrics for blob-slicer
Gathering detailed insights and metrics for blob-slicer
read all or part of the content in a Blob or File as a buffer or stream
npm install blob-slicer
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
46,270
Last Day
26
Last Week
131
Last Month
624
Last Year
13,712
MIT License
12 Commits
1 Forks
1 Branches
1 Contributors
Updated on Mar 24, 2019
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
blob-slicer@1.0.0
Size
3.21 kB
NPM Version
6.4.1
Node Version
10.15.3
Published on
Mar 23, 2019
Cumulative downloads
Total Downloads
Last Day
-38.1%
26
Compared to previous day
Last Week
-7.1%
131
Compared to previous week
Last Month
-19%
624
Compared to previous month
Last Year
67%
13,712
Compared to previous year
Read all or part of the content in a Blob or File as a Buffer or Stream
npm install blob-slicer
1var BlobSlicer = require('blob-slicer') 2 3var reader = new BlobSlicer(getBlobOrFileSomehow()) 4 5// Read as Buffer 6reader.read(start, end, function (error, buffer) { 7 if (error) { 8 // handle error 9 } 10 // handle data 11}) 12 13// Read as Stream 14reader.createReadStream() 15 .on('data', function (chunk) { ... }) 16 .on('error', function (error) { ... }) 17 .on('end', function () { ... })
blob-slicer depends on buffer v4.x . Therefore, if you are using browserify v14 and higher, you must include buffer v4 instead of the default v5 by either doing :
browserify -r buffer/:buffer main.js -o bundle.js
or
1browserify().require(require.resolve('buffer/'), { expose: 'buffer' })
Class: BlobSlicer
new BlobSlicer(blob)
Throws error if blob is not an instance of Blob or File.
blobSlicer.read([start], [end], callback)
Read a range of bytes delimited by start(inclusive) and end(exclusive).
If end is not specified, it reads all bytes from start to the end of blob.
If start and end are not specified, it reads all data in the blob.
The callback is passed two arguments (err: Error, buf: Buffer)
.
blobSlicer.createReadStream([options])
options
may be omitted, the default is {highWaterMark: 64 * 1024, start: 0, end: blob.size}
.
options.start
is inclusive, options.end
is exclusive.
Return an instance of ReadStream
.
Class: ReadStream
An implementation of Readable Streams.
readStream.readableLength: number
same as in stream_readable_readablelength
readStream.ended: boolean
true
if reached the end of blob (there may be still some bytes in the queue ready to be consumed).
MIT. Copyright (c) Hoummad Merzouqi.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
82 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More