Package Exports
- @hugoalh/temperature
Readme
Temperature (NodeJS)
| Release | Latest ( |
Pre ( |
|---|---|---|
| GitHub |
||
| NPM |
๐ Description
A NodeJS module to convert temperature units.
Units of temperature are from Wikipedia - Conversion of scales of temperature.
| Unit | Symbol | Symbol Lowercase | Name | Name Lowercase |
|---|---|---|---|---|
| Celsius | C |
c |
Celsius |
celsius |
| Fahrenheit | F |
f |
Fahrenheit |
fahrenheit |
| Kelvin | K |
k |
Kelvin |
kelvin |
| Rankine | R |
r |
Rankine |
rankine |
| Delisle | De |
de |
Delisle |
delisle |
| Sir Isaac Newton's degree of temperature (Newton) | N |
n |
Newton |
newton |
| Rรฉaumur | Re |
re |
Reaumur |
reaumur |
| Rรธmer | Ro |
ro |
Roemer, Romer |
roemer, romer |
๐ Note
- Degree symbol (
ยฐ) is not used in here.- In order to fulfill the JavaScript namespace naming requirement, some characters are replaced (e.g.:
รฉtoe,รธtoo).
๐ Documentation
Getting Started
Install
- NodeJS >= v6.9.0
- NPM >= v3.10.8
npm install @hugoalh/temperatureUse In CommonJS
const Temperature = require("@hugoalh/temperature");Use In ModuleJS
import Temperature from "@hugoalh/temperature";API
Class
Temperature(value: number, unit?: string = "K")Example
new Temperature(25, "C").K
//=> 298.15
new Temperature(298.15).C
//=> 25