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

0.5.0 • Public • Published

@metatypes/units

Unit conversion metadata.

Usage

BinaryPrefixes

import { BinaryPrefixes } from '@metatypes/units'

const BYTES = 14233423434
const MiB = BYTES / BinaryPrefixes.Mi

TimeConversion

import { TimeConversion } from '@metatypes/units'

const startDate = Date.now()
// some long process
const endDate = Date.now()

const deltaInMilliseconds = endDate - startDate
const deltaInSeconds =
	deltaInMilliseconds / TimeConversion.MILLISECONDS_PER_SECOND

alert(`Took ${deltaInSeconds}s to complete!`)

Package Sidebar

Install

npm i @metatypes/units

Weekly Downloads

225

Version

0.5.0

License

MIT

Unpacked Size

14 kB

Total Files

6

Last publish

Collaborators

  • florianwendelborn
  • dodekeract