1.4.1 • Published 4 years ago

@reslys/base64inbyte v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Base64 in Byte

npm (scoped) npm bundle size (scoped) GitHub license

Get base64 size in byte

Installation

npm install @reslys/base64inbyte --save-dev

Usage

import { formatBytes, b64inByte } from 'base64inbyte'

const fileSize = b64inByte(yourBase64)
console.log(fileSize) // 3485

const inBytes = formatBytes(fileSize)
console.log(inBytes) // 34.85 kb

Available Methods

b64inByte

Get base64 size in byte

/**
 * Get base64 size in byte
 * @param {base64} base64
 *
 * @return {integer} the size in bytes
 */

 b64inByte(base64)

formatBytes

Format integer of bytes to readable string such as 34.85 kb

/**
 * Format integer of file size
 * @param {integer} bytes
 *
 * @return {string} formatted size
 */

 formatBytes(bytes)
1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago