fetch-blob
Advanced tools
Comparing version 2.0.1 to 2.1.0
Changelog | ||
========= | ||
## v2.1.0 | ||
- Fix: .slice has an implementation bug (#54). | ||
- Added blob backed up by filesystem (#55) | ||
## v2.0.1 | ||
@@ -5,0 +9,0 @@ |
@@ -141,3 +141,3 @@ const {Readable} = require('stream'); | ||
blobParts.push(chunk); | ||
added += size; | ||
added += ArrayBuffer.isView(chunk) ? chunk.byteLength : chunk.size; | ||
relativeStart = 0; // All next sequental parts should start at 0 | ||
@@ -144,0 +144,0 @@ |
{ | ||
"name": "fetch-blob", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "A Blob implementation in Node.js, originally from node-fetch.", | ||
"main": "index.js", | ||
"files": [ | ||
"from.js", | ||
"index.js", | ||
@@ -51,3 +52,5 @@ "index.d.ts" | ||
}, | ||
"dependencies": {} | ||
"peerDependencies": { | ||
"domexception": "^2.0.1" | ||
} | ||
} |
@@ -30,2 +30,20 @@ # fetch-blob | ||
### Blob part backed up by filesystem | ||
To use, install [domexception](https://github.com/jsdom/domexception). | ||
```sh | ||
npm install fetch-blob domexception | ||
``` | ||
```js | ||
const blobFrom = require('fetch-blob/from.js'); | ||
const blob1 = blobFrom('./2-GiB-file.bin'); | ||
const blob2 = blobFrom('./2-GiB-file.bin'); | ||
// Not a 4 GiB memory snapshot, just holds 3 references | ||
// points to where data is located on the disk | ||
const blob = new Blob([blob1, blob2]); | ||
console.log(blob.size) // 4 GiB | ||
``` | ||
See the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and [tests](https://github.com/node-fetch/fetch-blob/blob/master/test.js) for more details. | ||
@@ -32,0 +50,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13312
7
262
58
1
2
1