fetch-blob
A Blob implementation in Node.js, originally from node-fetch.
Last updated 5 years ago by endless .
MIT · Repository · Bugs · Original npm
$ cnpm install fetch-blob 
SYNC missed versions from official npm registry.

fetch-blob

npm version build status coverage status install size

A Blob implementation in Node.js, originally from node-fetch.

Installation

npm install fetch-blob

Usage

const Blob = require('fetch-blob');
const fetch = require('node-fetch');

fetch('https://httpbin.org/post', {
    method: 'POST',
    body: new Blob(['Hello World'], { type: 'text/plain' })
})
    .then(res => res.json());
    .then(json => console.log(json));

Blob part backed up by filesystem

To use, install domexception.

npm install fetch-blob domexception
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 and tests for more details.

Current Tags

  • 3.2.0                                ...           latest (3 years ago)

9 Versions

  • 3.2.0                                ...           3 years ago
  • 3.1.5                                ...           3 years ago
  • 3.1.4                                ...           4 years ago
  • 3.1.3                                ...           4 years ago
  • 3.0.0-rc.0                                ...           4 years ago
  • 3.1.2                                ...           4 years ago
  • 2.1.1                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org