temp-units-conv
Convert temperature units (Kelvin, Celsius, Fahrenheit), lib + CLI. Based on snippets by doug65536 and jesus666 on #Node.js
Last updated 3 years ago by mk-pmb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install temp-units-conv 
SYNC missed versions from official npm registry.

temp-units-conv

unit conversions

Convert temperature units (Kelvin, Celsius, Fahrenheit), lib + CLI. Based on snippets by doug65536 and jesus666 on #Node.js

Try it live: Web Demo

simple

var tuc = require('temp-units-conv');
tuc.c2f(100);     // 212
tuc.f2k(212);     // 373.15
tuc.k2c(373.15);  // 100
tuc.fahrenheitToCelsius(451);   // 232.77…
tuc.celsiusToKelvin(232.77);    // 505.9…

objective

var tuc = require('temp-units-conv'),
  waterboil = new tuc.Temperature(100, 'C');
String(waterboil);  // '100.00 °C'
waterboil.unit;     // function Celsius(c) {…}

var americanWaterBoil = waterboil.toF();
String(americanWaterBoil);  // '212.00 °F'
americanWaterBoil.temp;     // 212
americanWaterBoil.unit.nameLong;  // 'degrees Fahrenheit'
americanWaterBoil.unit.nameShort; // '°F'

(new tuc.F(451)).toUnit('K').toString();  // '505.93 K'

var tempFromString = new tuc.Temperature('0 K');
tempFromString.toUnit('C').toString();    // '-273.15 °C'

shelly

$ tempconv 100C 451F 0K
100.00 °C       = 212.00 °F     = 373.15 K
451.00 °F       = 232.78 °C     = 505.93 K
0.00 K  = -459.67 °F    = -273.15 °C

License

MIT

Current Tags

  • 1.0.2                                ...           latest (3 years ago)

7 Versions

  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 5
Last Day 0
Last Week 2
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |