# node-b64

> Basic implementations of btoa and atob for Node v6+

Latest version **0.0.3** (published 2016-10-07) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install node-b64
pnpm add node-b64
yarn add node-b64
bun add node-b64
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-10-07 |
| First published | 2016-09-16 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alex Dulin |
| Maintainers | adulin |
| Keywords | base64, atob, btoa |

## Links

- npm: https://www.npmjs.com/package/node-b64
- Repository: https://github.com/alexdulin/node-b64
- Homepage: https://github.com/alexdulin/node-b64#readme
- Issues: https://github.com/alexdulin/node-b64/issues
- npm.io page: https://npm.io/package/node-b64

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-10-07
- 0.0.2 — 2016-09-16
- 0.0.1 — 2016-09-16

## README

# node-b64
Basic implementations of btoa and atob for Node v6+


### Why?
Becaue I got tired of writing
```js
Buffer.from(x, 'base64').toString('utf8');
```


### Usage

Using the entire module:

```js
"use strict";

const b64 = require('node-b64');

const str = 'this is some stuff';


/**
 * Encode a string
 */
b64.btoa(str);

// Prints -> 'dGhpcyBpcyBzb21lIHN0dWZm'


/**
 * Decode a string
 */

b64.atob(b64.btoa(str));

// Prints -> 'this is some stuff'


/**
 * Works with buffers too
 */
btoa(Buffer.from('foo')) === btoa('foo')

// true

```


Or just use one of the two functions:

```js
const btoa = require('node-b64/btoa');
const atob = require('node-b64/atob');

const str2 = 'this is other stuff';

btoa(str2);

atob(btoa(str2));

```

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