node-save-blob
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

node-save-blob

To save a Blob as file to the Downloads folder, for Node.js and browsers

Inspired by navigator.msSaveBlob

Usage

In Node.js

import {saveBlob} from 'node-save-blob';

let blob = new Blob(['hello'], {type:'text/plain'});

let filePath = await saveBlob(blob, 'hello.txt'); 
console.log('downloaded as '+filePath);

In browsers

import {saveBlob} from 'node-save-blob';

let blob = new Blob(['hello'], {type:'text/plain'});

let started = saveBlob(blob, 'hello.txt');
console.log('download '+(started?'started':'failed'));

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    1

Package Sidebar

Install

npm i node-save-blob

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

6.34 kB

Total Files

6

Last publish

Collaborators

  • fuweichin