Project

byteme

0.0
No commit activity in last 3 years
No release in over 3 years
A simple CLI that converts between bytes, kilobytes, megabytes, etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.8.0, ~> 1.8
 Project Readme

ByteMe

A simple CLI for converting between bytes, kilobytes, megabytes, etc. Can you just Google it? Yes. Is leaving terminal for newbs? Maybe.

image

Installation

gem install byteme

Usage

byteme <input value> <input format>

If no input format is specified, Bytes is assumed. You can pass the -r or --round flag to print output as rounded floats instead of in scientific notation.

Input/Output format can be any value from the left-hand column:

Argument Corresponds To
B Bytes
KB Kilobytes
MB Megabytes
GB Gigabytes
TB Terabytes
PB Petabytes
b Bits
kb Kilobits
mb Megabits
gb Gigabits
tb Terabits
pb Petabits
KiB Kibibytes
MiB Mebibytes
GiB Gibibytes
TiB Tebibytes
PiB Pebibytes

Examples:

$ byteme 1000

$ byteme 1000 GB

$ byteme 1000 kb -r

Example output:

+-----------+-----------------------+
| Type      | Value                 |
+-----------+-----------------------+
| Bytes     | 1000                  |
| Kilobytes | 1                     |
| Megabytes | 0.001                 |
| Gigabytes | 1.0e-06               |
| Terabytes | 1.0e-09               |
| Petabytes | 1.0e-12               |
+-----------+-----------------------+
| Bits      | 8000                  |
| Kilobits  | 0.125                 |
| Megabits  | 0.000125              |
| Gigabits  | 1.25e-07              |
| Terabits  | 1.25e-10              |
| Petabits  | 1.25e-13              |
+-----------+-----------------------+
| Kibibytes | 0.9765625             |
| Mebibytes | 0.00095367431640625   |
| Gibibytes | 9.313225746154785e-07 |
| Tebibytes | 9.094947017729282e-10 |
| Pebibytes | 8.881784197001252e-13 |
+-----------+-----------------------+

Link to RubyGems: https://rubygems.org/gems/byteme

PRs are welcome!