Package Exports
- @iamhunter/temperature-converter
- @iamhunter/temperature-converter/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@iamhunter/temperature-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-converterUsage
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.