unit-cnv
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Unit Converter

A TypeScript package to convert between different units of measurement, such as length, temperature, time, and more.

Installation

To install the package, run the following command:

npm install unit-cnv

Usage

Import the necessary modules for the units you want to convert. For example, to convert time:

import { Time } from "unit-cnv";

const Seconds = Time.Seconds;

const secondsValue = 120;
const minutesValue = Seconds.toMinutes(secondsValue);
console.log(`${secondsValue} seconds equals ${minutesValue} minutes`);

Or by default:

import converter from "unit-cnv";

const Seconds = converter.Time.Seconds;

const secondsValue = 120;
const minutesValue = Seconds.toMinutes(secondsValue);
console.log(`${secondsValue} seconds equals ${minutesValue} minutes`);

Features

  • Mass Conversion
  • Length Conversion
  • Temperature Conversion
  • Time Conversion

Contributing

If you would like to contribute to this project, feel free to open an issue or submit a pull request.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i unit-cnv

    Weekly Downloads

    0

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    310 kB

    Total Files

    58

    Last publish

    Collaborators

    • watter