simple-conversions

A NPM package to simply convert measurements and other things.


Keywords
convert, converting, conversion, inches, miles, kilometers, feet, centimeters, in, mi, km, ft, cm, simple, converted, celsius, fahrenheit, kelvin, k, c, f, mph, kph, knot, knots, miles-per-hour, kilometers-per-hour
License
ISC
Install
npm install simple-conversions@1.0.1

Documentation

Simple Conversions

npm version license

A NPM package / GitHub repository to simply convert measurements and other things.

Install using

npm i simple-conversions

How to use:

Length

var convert = require('simple-conversions')

console.log(convert.MilesToKM(1)) // 1 = amount of miles

Output: 1.61

var convert = require('simple-conversions')

console.log(convert.InToCM(1)) // 1 = amount of inches

Output: 2.54

var convert = require('simple-conversions')

console.log(convert.InToFT(12)) // 12 = amount of inches

Output: 1

var convert = require('simple-conversions')

console.log(convert.FtToIN(1)) // 1 = amount of feet

Output: 12

var convert = require('simple-conversions')

console.log(convert.CmToFT(30.48)) // 30.48 = amount of centimeters

Output: 1

var convert = require('simple-conversions')

console.log(convert.FtToCM(1)) // 1 = amount of feet

Output: 30.48

Per-Hour measurements

var convert = require('simple-conversions')

console.log(convert.MphToKPH(1)) // 1 = amount of miles per hour

Output: 1.609344

var convert = require('simple-conversions')

console.log(convert.KphToMPH(1)) // 1 = amount of kilometers per hour

Output: 0.621371192237334

var convert = require('simple-conversions')

console.log(convert.KphToKT(1)) // 1 = amount of kilometers per hour

Output: 1.852

var convert = require('simple-conversions')

console.log(convert.MphToKT(1)) // 1 = amount of miles per hour

Output: 0.8688097306689835

var convert = require('simple-conversions')

console.log(convert.KtToMPH(1)) // 1 = amount of knots

Output: 1.151

var convert = require('simple-conversions')

console.log(convert.KtToKPH(1)) // 1 = amount of knots

Output: 0.5399568034557235

Temperatures

var convert = require('simple-conversions')

console.log(convert.FtoC(32)) // 32 = fahrenheit value

Output: 0

var convert = require('simple-conversions')

console.log(convert.CtoF(0)) // 0 = celsius value

Output: 32

var convert = require('simple-conversions')

console.log(convert.FtoK(32)) // 32 = fahrenheit value (to kelvin)

Output: 273.15

var convert = require('simple-conversions')

console.log(convert.CtoK(0)) // 0 = celsius value (to kelvin)

Output: 273.15

var convert = require('simple-conversions')

console.log(convert.KtoF(273.15)) // 273.15 = kelvin value

Output: 32

var convert = require('simple-conversions')

console.log(convert.KtoC(273.15)) // 273.15 = kelvin value

Output: 0

Repository

GitHub
GitHub/Bugs
GitHub/README
NPM Package
Run on RunKit

Thanks for looking at!