1.0.3 • Published 1 year ago

@iamhunter/temperature-converter v1.0.3

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

Temperature Converter

A simple and flexible temperature converter for Node.js and the browser, with support for a wide range of temperature scales, including Celsius, Fahrenheit, Kelvin, and Newton.

Installation

You can install the package via npm:

npm install @iamhunter/temperature-converter

Usage

import { convertTemperature, TemperatureScale } from "@iamhunter/temperature-converter";

const temperature = 20;
const fromUnit: TemperatureScale = "C";
const toUnit: TemperatureScale = "F";

const convertedTemperature = convertTemperature(temperature, fromUnit, toUnit);

console.log(`${temperature} ${fromUnit} is ${convertedTemperature} ${toUnit}.`);
// Output: 20 C is 68 F.

Supported Temperature Scales

The temperature converter supports the following temperature scales:

  • Celsius (C)
  • Fahrenheit (F)
  • Kelvin (K)
  • Newton (N)

License

This package is open source and available under the MIT License.

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago