# btoa

> btoa for Node.JS (it's a one-liner)

Latest version **1.2.1** (published 2018-03-28) · (MIT OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install btoa
pnpm add btoa
yarn add btoa
bun add btoa
```

Provides the command `btoa`.

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-03-28 |
| First published | 2011-09-09 |
| Weekly downloads | 0 |
| License | (MIT OR Apache-2.0) |
| TypeScript types | separate (@types/btoa) |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 0 |
| Unpacked size | 31.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | AJ ONeal |
| Maintainers | coolaj86 |
| Keywords | btoa, browser |

## Links

- npm: https://www.npmjs.com/package/btoa
- Repository: https://git.coolaj86.com/coolaj86/btoa.js
- Homepage: https://git.coolaj86.com/coolaj86/btoa.js.git
- npm.io page: https://npm.io/package/btoa

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-03-28
- 1.1.2 — 2014-05-20
- 1.1.1 — 2013-07-25
- 1.1.0 — 2012-09-19
- 1.0.1 — 2012-06-26
- 1.0.0 — 2011-09-09

## README

btoa
===

| [atob](https://git.coolaj86.com/coolaj86/atob.js)
| **btoa**
| [unibabel.js](https://git.coolaj86.com/coolaj86/unibabel.js)
| Sponsored by [ppl](https://ppl.family)

A port of the browser's `btoa` function.

Uses `Buffer` to emulate the exact functionality of the browser's btoa
(except that it supports some unicode that the browser may not).

It turns <strong>b</strong>inary data __to__ base64-encoded <strong>a</strong>scii.

```js
(function () {
  "use strict";

  var btoa = require('btoa');
  var bin = "Hello, 世界";
  var b64 = btoa(bin);

  console.log(b64); // "SGVsbG8sIBZM"
}());
```

**Note**: Unicode may or may not be handled incorrectly.
This module is intended to provide exact compatibility with the browser.

Copyright and License
===

Code copyright 2012-2018 AJ ONeal

Dual-licensed MIT and Apache-2.0

Docs copyright 2012-2018 AJ ONeal

Docs released under [Creative Commons](https://git.coolaj86.com/coolaj86/btoa.js/blob/master/LICENSE.DOCS).

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