Dead simple, single file, tiny byte formatter

Overview

tiny-byte-size

Dead simple, no configuration needed, tiny byte formatter

npm install tiny-byte-size

Usage

const byteSize = require('tiny-byte-size')

console.log(byteSize(100)) // 100B
console.log(byteSize(1000)) // 1kB
console.log(byteSize(1100)) // 1.1kB
console.log(byteSize(10101010)) // 10.1MB
console.log(byteSize.perSecond(10101010)) // 10.1MB/s
console.log(byteSize.perSecond(10101010, 500)) // 20.2MB/s

License

MIT

You might also like...

Dead-simple CORS handling for any itty-router API (test with Cloudflare Workers, but works anywhere)!

Dead-simple CORS handling for any itty-router API (test with Cloudflare Workers, but works anywhere)!

Simple CORS-handling for any itty-router API. Designed on Cloudflare Workers, but works anywhere. Features Tiny. Currently ~600 bytes, with zero-depen

Dec 16, 2022

A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil 👋 A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Jun 20, 2022

Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Dec 15, 2022

Obsidian plugin: get things dead day by day

Obsidian Daily Todo Pro Plugin 中文说明 inspired by https://github.com/shichongrui/obsidian-rollover-daily-todos get things dead day by day - enhance your

Sep 18, 2022

Provides a KafkaJS-compatible handler for processing messages that facilitates publishing to delayed-retry or dead-letter topics

kafkajs-async-retry This module handles retries and dead-lettering for messages from a Kafka topic without blocking the processing of subsequent messa

Dec 5, 2022

A script that combines a folder of SVG files into a single sprites file and generates type definitions for safe usage.

remix-sprites-example A script that combines a folder of .svg files into a single sprites.svg file and type definitions for safe usage. Technical Over

Nov 9, 2022

optimize image & upload file to cloud as image bed with tiny image automic.

optimize image & upload file to cloud as image bed with tiny image automic.

Rush! 图片压缩 & 直传图床工具 这是一个兴趣使然的项目, 希望 Rush! 能让这个世界的网络资源浪费减少一点点 下载 Downloads 获取最新发行版 功能 Features 拖拽批量压缩图片, 支持格式 jpg/png/gif Drop to optimize, jpg/png/gif

Nov 12, 2022

A simple react project that contain a single page application (SPA) And a simple caculator to make some calculation and there is a section you can see some Math quotes. Ⓜ💯

A simple react project that contain a single page application (SPA) And a simple caculator to make some calculation and there is a section you can see some Math quotes. Ⓜ💯

May 31, 2022

With this File Manager prepared for PHP/Js, you can perform all file operations on your server without any problems.

FileManager With this File Manager prepared for PHP/Js, you can perform all file operations on your server without any problems. Instead of downloadin

Sep 23, 2022
Owner
Mathias Buus
Rød grød med fløde
Mathias Buus
Halfwit is an experimental golfing language that fits most commands in half a byte.

Halfwit Halfwit is an experimental golfing language that fits most commands in half a byte. It's stack-based. Usage npm install halfwit

Chunkybanana 12 Jun 27, 2022
All-in-one code linter and formatter for TypeScript and JavaScript

Uniform is a CLI tool - code linter and formatter for JavaScript and TypeScript. Works using eslint and prettier under the hood.

Irakli Dautashvili 21 Feb 27, 2022
A WASM shell parser and formatter with bash support, based on mvdan/sh

sh-syntax A WASM shell parser and formatter with bash support, based on mvdan/sh TOC Usage Install API Changelog License Usage Install # yarn yarn add

RxTS 7 Jan 1, 2023
A code formatter for the Motoko smart contract language.

Motoko Formatter · A Prettier plugin for the Motoko programming language. Setup After making sure Node.js is installed on your local machine, run the

DFINITY 25 Dec 19, 2022
The commercial Cheesgle Byte.

Cheesgle-Byte The commercial Cheesgle Byte. https://one.byte.cheesgle.com/ The LICENSE to this software is provided in the file marked LICENSE Contrib

coding398 7 Oct 20, 2022
Dead simple program to upload NFT data to IPFS via nft.storage

NFTP The simplest way to publish files and folders to IPFS, with one command. 100% FREE to upload as much files as you want, powered by nft.storage. N

factoria 35 Dec 11, 2022
A dead simple JWT-based authentication library for Next.js framework.

nexauth A dead simple JWT-based authentication library for Next.js framework. Getting Started Visit https://betagouv.github.io/nexauth/#/install to ge

beta.gouv.fr 12 Aug 2, 2022
A dead-simple Bookmarklet and Chrome Extension implementation of something like Bionic Reading

What is it? Inspired by Bionic Reading, this Bookmarklet modifies a webpage to display the first half of each word in bold. Can also be installed as a

null 35 Dec 5, 2022
🛡️ Dead-simple, yet highly customizable security middleware for Apollo GraphQL servers and Envelop 🛡️

GraphQL Armor ??️ GraphQL Armor is a dead-simple yet highly customizable security middleware for various GraphQL server engines. Contents Contents Sup

Escape – GraphQL Security 267 Jan 9, 2023
Dead simple cookie-based session for Deno Fresh.

Fresh Session ?? Dead simple cookie-based session for Deno Fresh. Get started Fresh Session comes with a simple middleware to add at the root of your

Steven Yung 38 Jan 5, 2023