Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

b64

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b64

Base64 streaming encoder and decoder

  • 4.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
64K
increased by1.78%
Maintainers
2
Weekly downloads
 
Created
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

Package last updated on 03 Nov 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc