temperature.conversion
Version:
Temperature Conversion NPM Module (as requested by Jtryon from Livecoding.tv)
45 lines (36 loc) • 1.25 kB
Markdown
# temperature.conversion [](https://coveralls.io/github/ChrisCates/temperature.conversion?branch=master) [](https://travis-ci.org/ChrisCates/temperature.conversion)
## Temperature Conversion NPM Module (as requested by Jtryon from Livecoding.tv)
### By Chris Cates :star:
### Email: hello@chriscates.ca
### Usage (As described in tests.js)
```javascript
describe('Celsius to Fahrenheit', () => {
it('Should return 32', () => {
assert(calc.celsiusToFahrenheit(0),32)
})
it('Should return 77', () => {
assert(calc.celsiusToFahrenheit(25),77)
})
it('Should return 50', () => {
assert(calc.celsiusToFahrenheit(50),122)
})
})
describe('Fahrenheit to Celsius', () => {
it('Should return -15', () => {
assert(calc.fahrenheitToCelsius(5), -15)
})
it('Should return 10', () => {
assert(calc.fahrenheitToCelsius(50), 10)
})
it('Should return 40', () => {
assert(calc.fahrenheitToCelsius(104), 40)
})
})
```
### Usage as command line tool
```javascript
c2f 20
// returns 68
f2c 50
// returns 10
```