# base64-blob

> A module for interconversion of base64 and blob, wrapped by Promise

Latest version **1.4.1** (published 2019-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install base64-blob
pnpm add base64-blob
yarn add base64-blob
bun add base64-blob
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2019-07-23 |
| First published | 2018-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | livelybone |
| Maintainers | livelybone |
| Keywords | base64, blob, conversion, base64 to blob, blob to base64, dataUrl |

## Links

- npm: https://www.npmjs.com/package/base64-blob
- Repository: https://github.com/livelybone/base64-blob
- Homepage: https://github.com/livelybone/base64-blob#readme
- Issues: https://github.com/livelybone/base64-blob/issues
- npm.io page: https://npm.io/package/base64-blob

## Dependencies (1)

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

## 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

- 1.4.1 (latest) — 2019-07-23
- 1.4.0 — 2019-07-23
- 1.3.0 — 2019-01-06
- 1.2.1 — 2018-10-11
- 1.2.0 — 2018-10-11
- 1.1.0 — 2018-10-11
- 1.0.0 — 2018-10-11

## README

# base64-blob
[![NPM Version](http://img.shields.io/npm/v/base64-blob.svg?style=flat-square)](https://www.npmjs.com/package/base64-blob)
[![Download Month](http://img.shields.io/npm/dm/base64-blob.svg?style=flat-square)](https://www.npmjs.com/package/base64-blob)
![gzip with dependencies: .5kb](https://img.shields.io/badge/gzip--with--dependencies-.5kb-brightgreen.svg "gzip with dependencies: .5kb")
![typescript](https://img.shields.io/badge/typescript-supported-blue.svg "typescript")
![pkg.module](https://img.shields.io/badge/pkg.module-supported-blue.svg "pkg.module")

> `pkg.module supported`, which means that you can apply tree-shaking in you project

A module for interconversion of base64 and blob, wrapped by Promise

You may need a Promise polyfill while use old `IE` browser

## repository
https://github.com/livelybone/base64-blob.git

## Demo
http://github.com/livelybone/base64-blob@readme

## Installation
```bash
npm i -S base64-blob
```

## Global name
`Base64_Blob`

## Usage
```js
import { base64ToBlob, blobToBase64 } from 'base64-blob'
```

when you want to set this module as external while you are developing another module, you should import it like this:
```js
import * as Base64_Blob  from 'base64-blob'

// then use it by need
```

Use in html, see what your can use in [CDN: unpkg](https://unpkg.com/base64-blob/lib/umd/)
```html
<script src="https://unpkg.com/base64-blob@[version]/lib/umd/index.js"></script>
```

## Functions

```typescript
/** Format: /^data:[\w\d]*\/[\d\w]*;base64,.*$/ */
type Base64Url = string
```

### base64ToBlob
> `(base64: Base64Url) => Promise<Blob>`

### blobToBase64

> `(blob: Blob) => Promise<Base64Url>`

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