1.0.4 • Published 1 year ago

@nacho-cs/byte-sized v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

byte-size

Easily convert an exact byte measurement to a file size and vice versa


Install:

Run:

$ npm i byte-size

Then add either:

import bytes from "byte-sized"; // ES6

or

const bytes = require("byte-sized"); // CommonJS

to your JS code


How to use

From there, simply call the function bytesize() and pass in a value, going up to petabytes

import bytes from "byte-sized";
console.log(bytes(696969)); // 680.63 KB
console.log(bytes("69 KB")); // 70656 bytes
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago