@37bytes/units-helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@37bytes/units-helper

This package is a utility for working with various units of measurement in JavaScript/TypeScript. It includes two modules: SizeUnit and TimeUnit, which provide functions for converting values between different units of size and time, respectively.

Installation

To install the package, run the following command:

npm install @37bytes/units-helper

Usage

SizeUnit

The SizeUnit module contains the following functions:

  • getKilobytes(value: number): Returns the value in kilobytes for the given number.
  • getMegabytes(value: number): Returns the value in megabytes for the given number.
  • getGigabytes(value: number): Returns the value in gigabytes for the given number.

TimeUnit

The TimeUnit module contains the following functions:

  • getSeconds(value: number): Returns the value in seconds for the given number.
  • getMinutes(value: number): Returns the value in minutes for the given number.
  • getHours(value: number): Returns the value in hours for the given number.
  • getDays(value: number): Returns the value in days for the given number.
  • getWeeks(value: number): Returns the value in weeks for the given number.

Package Sidebar

Install

npm i @37bytes/units-helper

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

8.67 kB

Total Files

8

Last publish

Collaborators

  • arhonist-37b
  • rispaev
  • yar_vav
  • rteslenko
  • tnikolaeva
  • dc.nikolaev
  • mgarmash