# stream-to-blob-url

> Convert a Readable Stream to a Blob URL

Latest version **3.0.2** (published 2020-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install stream-to-blob-url
pnpm add stream-to-blob-url
yarn add stream-to-blob-url
bun add stream-to-blob-url
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2020-05-10 |
| First published | 2015-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | stream, buffer, convert stream to blob url, blob url, convert, length, name |

## Links

- npm: https://www.npmjs.com/package/stream-to-blob-url
- Repository: https://github.com/feross/stream-to-blob-url
- Issues: https://github.com/feross/stream-to-blob-url/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/stream-to-blob-url

## Dependencies (1)

- [stream-to-blob](https://npm.io/package/stream-to-blob.md) ^2.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 3.0.2 (latest) — 2020-05-10
- 3.0.1 — 2020-05-10
- 3.0.0 — 2019-08-07
- 2.1.2 — 2019-06-28
- 2.1.1 — 2018-06-09
- 2.1.0 — 2016-06-15
- 2.0.0 — 2016-02-03
- 1.0.0 — 2015-12-29

## README

# stream-to-blob-url [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/stream-to-blob-url/master.svg
[travis-url]: https://travis-ci.org/feross/stream-to-blob-url
[npm-image]: https://img.shields.io/npm/v/stream-to-blob-url.svg
[npm-url]: https://npmjs.org/package/stream-to-blob-url
[downloads-image]: https://img.shields.io/npm/dm/stream-to-blob-url.svg
[downloads-url]: https://npmjs.org/package/stream-to-blob-url
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

#### Convert a Readable Stream to a Blob URL

[![Sauce Test Status](https://saucelabs.com/browser-matrix/stream-to-blob-url.svg)](https://saucelabs.com/u/stream-to-blob-url)

This package converts a Readable Stream into a Blob URL.

This package is used by [WebTorrent](https://webtorrent.io).

## install

```
npm install stream-to-blob-url
```

## usage

```js
const toBlobURL = require('stream-to-blob-url')
const fs = require('fs')

const blobUrl = await toBlobURL(fs.createReadStream('file.txt'))
console.log(url)
```

## api

### promise = toBlobURL(stream, [mimeType], callback)

Convert the Readable `stream` into a W3C `Blob` URL (`blob:...`), optionally,
with the given `mimeType`.

Returns a `Promise` which resolves to a `string` on success. Otherwise, rejects
with an `Error`.

## license

MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org).

---
_Source: https://npm.io/package/stream-to-blob-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
