2.0.1 • Published 2 years ago

@khanisak/temperature-converter v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Temperature Converter

Lightweight javascript library to calculate Temperature values.

Installation

With npm :

npm install --save @khanisak/temperature-converter

Usage

import { Celcius, Fahrenheit, Kelvin } from '@khanisak/temperature-converter';

Use it

// "Celcius to Fahrenheit
const fahrenheit =  new Celcius(15).toFahrenheit(); 
console.log(fahrenheit.value); // will result 59
console.log(fahrenheit.unit); // { name: "Fahrenheit", code: "°F" }

// "Fahrenheit to Kelvin
const kelvin = new Fahrenheit(15).toKelvin();
console.log(kelvin.value); // will result 263.7055555555555
console.log(kelvin.unit); // { name: "Kelvin", code: "°K" }

// "Kelvin to Celcius
const celcius = new Kelvin(15).toCelcius();
console.log(celcius.value); // will result -258.15
console.log(celcius.unit); // { name: "Celcius", code: "°C" }

list all temperature units available

import { units } from '@khanisak/temperature-converter';

console.log(units);

Temperature Property

NameTypeDescription
valuenumbervalue of current temperature
unitobjectname and code of current unit. ex: { name: "Celcius", code: '°C' }

License

This project is licensed under the MIT License

2.0.1-alpha.1

2 years ago

2.0.1-alpha.2

2 years ago

2.0.0-alpha.1

2 years ago

2.0.0-alpha.2

2 years ago

2.0.1

2 years ago

2.0.2-alpha.1

2 years ago

2.0.0

2 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago