ascii2binary
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

npm GitHub stars GitHub issues GitHub license CI via GitHub Actions

English | 简体中文

ascii2binary

Base64-string to ArrayBuffer

Install

// npm
$ npm install --save ascii2binary

// yarn
$ yarn add ascii2binary

// pnpm
$ pnpm add ascii2binary

Usage

ES6 Module

// Note that there is no default export
import { ascii2binary } from 'ascii2binary';

node.js (commonjs)

// Note that there is no default export
const { ascii2binary } = require('ascii2binary')

Use

// Input base64 string
ascii2binary('yq==') // ArrayBuffer: [202]

Convert Picture

// Base64 string to ArrayBuffer
const base64 = 'iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAV0lEQVQImWP8DwQMWAATjPFkZztDuLUBg5pJBEP1+vsMjGAdj1YyhHu0M5yHq5eG6njzFEkQBJ5CJUSkGQxRJKQZGP5DweMdbf/DrPT/qxqH/69ad+8/AGWjJsYqydAgAAAAAElFTkSuQmCC'
ascii2binary(base64) // ArrayBuffer: [...]

Development and construction

Installation Dependencies

$ pnpm install

Repackage

$ pnpm run build

Test

It is necessary to install the development software

$ pnpm run test

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i ascii2binary

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    33 kB

    Total Files

    14

    Last publish

    Collaborators

    • 5102a