initial
Simple package for deno to convert temperature.
Repository
Current version released
4 years ago
Versions
Temperature
Simple package for deno to convert temperature.
Features
- simple
- fast
- easy to use
Example
import Converter from "https://raw.githubusercontent.com/Snowflake107/temperature/master/mod.ts";
// celsius
const celsius = new Converter.Celsius(35);
const obc = {
name: "Celsius",
deg: celsius.degrees,
fah: celsius.toFahrenheit(),
kel: celsius.toKelvin(),
str: celsius.toString(),
};
console.table(obc);
/*
Expected Output:
βββββββββ¬ββββββββββββ
β (idx) β Values β
βββββββββΌββββββββββββ€
β name β "Celsius" β
β deg β 35 β
β fah β 95 β
β kel β 308.15 β
β str β "35Β°C" β
βββββββββ΄ββββββββββββ
*/
// fahrenheit
const fahrenheit = new Converter.Fahrenheit(95);
const obf = {
name: "Fahrenheit",
deg: fahrenheit.degrees,
cel: fahrenheit.toCelsius(),
kel: fahrenheit.toKelvin(),
str: fahrenheit.toString(),
};
console.table(obf);
/*
Expected Output:
βββββββββ¬βββββββββββββββ
β (idx) β Values β
βββββββββΌβββββββββββββββ€
β name β "Fahrenheit" β
β deg β 95 β
β cel β 35 β
β kel β 308.15 β
β str β "95Β°F" β
βββββββββ΄βββββββββββββββ
*/
// kelvin
const kelvin = new Converter.Kelvin(308.15);
const obk = {
name: "Kelvin",
deg: kelvin.degrees,
cel: kelvin.toCelsius(),
fah: kelvin.toFahrenheit(),
str: kelvin.toString(),
};
console.table(obk);
/*
Expected Output:
βββββββββ¬ββββββββββββ
β (idx) β Values β
βββββββββΌββββββββββββ€
β name β "Kelvin" β
β deg β 308.15 β
β cel β 35 β
β fah β 95 β
β str β "308.15K" β
βββββββββ΄ββββββββββββ
*/
Running (No permissions required)
deno run <yourfile>