JSPM

@iamhunter/temperature-converter

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q26375F
  • License MIT

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.

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-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.