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

binconv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binconv

Binary converters for Blob, Uint8Array, ReadableStream, ArrayBuffer, string in JavaScript/TypeScript

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
94
increased by44.62%
Maintainers
1
Weekly downloads
 
Created
Source

binconv

npm CircleCI

Binary converters for Blob, Uint8Array, ReadableStream, ArrayBuffer, string in JavaScript/TypeScript

Installation

npm i -S binconv

Converters

Here are avaiable converters.
Naming rule: AB should be aToB().

conversionfunction
Base64Uint8Arraybase64ToUint8Array()
BlobArrayBufferblobToArrayBuffer()
BlobReadableStreamblobToReadableStream()
BlobUint8ArrayblobToUint8Array()
ReadableStreamBlobreadableStreamToBlob()
ReadableStreamUint8ArrayreadableStreamToUint8Array()
stringUint8ArraystringToUint8Array()
stringArrayBufferstringArrayBuffer()
Uint8ArrayArrayBufferuint8ArrayToArrayBuffer()
Uint8Array → Base64uint8ArrayToBase64()
Uint8ArrayBlobuint8ArrayToBlob()
Uint8Array → hex stringuint8ArrayToHexString()
Uint8ArrayReadableStreamuint8ArrayToReadableStream()
Uint8Arraystringuint8ArrayToString()

Usage

import * as binconv from 'binconv';

const blob = new Blob(["this is a blob"]);
const readableStream = binconv.blobToReadableStream(blob);

Usage (on-demand import)

You can import only specific conversion to reduce file size.

import {blobToReadableStream} from 'binconv/dist/src/blobToReadableStream';

const blob = new Blob(["this is a blob"]);
const readableStream = blobToReadableStream(blob);

Keywords

FAQs

Package last updated on 02 Feb 2020

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