Socket
Socket
Sign inDemoInstall

b64

Package Overview
Dependencies
1
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    b64

Base64 streaming encoder and decoder


Version published
Weekly downloads
47K
increased by10.76%
Maintainers
2
Install size
41.1 kB
Created
Weekly downloads
 

Readme

Source

Base64 streaming encoder and decoder

Build Status

Lead Maintainer - Wyatt Preul

Installation

npm install b64 --save

API

encode(buffer)

Base64 encode the buffer and return it as a new Buffer.

decode(buffer)

Base64 decode the buffer and return the result as a new buffer.

Encoder

Transform stream that base64 encodes each chunk of the stream.

Example:

'use strict';

const Fs = require('fs');
const B64 = require('b64');

const stream = Fs.createReadStream(`${__dirname}/package.json`);
const encoder = new B64.Encoder();

stream.pipe(encoder).pipe(process.stdout);

Decoder

Transform stream that base64 decodes each chunk of the stream.

Example:

'use strict';

const Fs = require('fs');
const B64 = require('b64');

const stream = Fs.createReadStream(`${__dirname}/encodedfile.b64`);
const decoder = new B64.Decoder();

stream.pipe(decoder).pipe(process.stdout);

base64urlEncode(value)

Encodes value of string or buffer type in Base64 or URL encoding, function will assert input value is correct.

base64urlDecode(value)

Decodes string into Base64 or URL encoding, function throws an error on invalid input and returns a string or buffer depending on encoding provided. Default encoding is binary.

Keywords

FAQs

Last updated on 03 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc