unit-conversion-pkg
unit-conversion-pkg is a Node.js package for converting units.
Installation
This is a Node.js module available through the npm registry. Installation is done using the npm install command:
npm install unit-conversion-pkg
Usage
const cu = ; cu # returns the converted value of 2 meters in all the other unitscu # returns the converted value of 2 milliliters in all the other unitscuresult'km' # returns the converted value of 2 meters in kilometers
API
Types
dist Distance
-
mic ----> Micron
-
mm ----> Millimeter
-
cm ----> Centimeter
-
m ----> Meter
-
km ----> Kilometer
-
mil ----> Mils/Thou
-
in ----> Inches
-
ft ----> Feet
-
yd ----> Yards
-
mi ----> Miles
-
nm ----> Nautical Miles
-
fm ----> Fathoms
-
ch ----> Chains
-
fur ----> Furlongs
-
ly ----> Light Years
area Area
-
sqmm ----> Sq. Millimeter
-
sqcm ----> Sq. Centimeter
-
sqm ----> Sq. Meter
-
ha ----> Hectares
-
sqkm ----> Sq. Kilometer
-
sqin ----> Sq. Inches
-
sqft ----> Sq. Feet
-
sqyd ----> Sq. Yards
-
ac ----> Acres
-
sqmi ----> Sq. Miles
vol Volume
-
ml ----> Milliliters (cc)
-
l ----> Liters
-
cum ----> Cu. Meter
-
cuin ----> Cu. Inch
-
cuft ----> Cu. Feet
-
cuyd ----> Cu. Yard
-
ozimp ----> Fluid Ounce (IMPERIAL)
-
ptimp ----> Pint (IMPERIAL)
-
galimp ----> Gallon (IMPERIAL)
-
ozus ----> Fluid Ounce (US)
-
ptus ----> Pint (US)
-
galus ----> Gallon (US)
mass Mass
-
micg ----> Micrograms
-
mg ----> Milligrams
-
g ----> Grams
-
kg ----> KG
-
t ----> Ton
-
oz ----> Ounce
-
lb ----> Pound
-
st ----> Stone
-
cwtus ----> Hundredweight (US)
-
cwtuk ----> Hundredweight (UK)
-
stus ----> Short Tons (US)
-
stuk ----> Long Tons (UK)
speed Speed
-
mps ----> Meter per sec
-
kmph ----> KMPH
-
ftps ----> Feet per second
-
mph ----> MPH
-
kt ----> Knots
time Time
-
ns ----> Nanoseconds
-
mics ----> Microseconds
-
ms ----> Milliseconds
-
s ----> Seconds
-
min ----> Minutes
-
hr ----> Hours
-
d ----> Days
-
wk ----> Weeks
-
yrg ----> Years (Gregorian)
-
yrj ----> Years (Julian)
force Force
-
micn ----> Micro-newtons
-
mn ----> Millinewtons
-
n ----> Newtons
-
kn ----> Kilonewtons
-
kgf ----> Kilogram-Force
-
lbf ----> Pound Force
press Pressure
-
pa ----> Pascal
-
hpa ----> Hectopascal
-
kpa ----> Kilopascal
-
mpa ----> Megapascal
-
mbar ----> Millibar
-
bar ----> Bar
-
atm ----> atm
-
kgpsqcm ----> Kilogram per sq. cm
-
psi ----> psi
-
hg ----> Inches of Mercury
-
torr ----> Torr
energy Energy
-
j ----> Joules
-
kj ----> Kilojoules
-
mj ----> Megajoules
-
kwh ----> kWh
-
cal ----> Calories
-
kcal ----> Kilocalories
-
btu ----> BTU
power Power
-
w ----> Watts
-
kw ----> Kilowatts
-
mw ----> Megawatts
-
calps ----> Calories per sec
-
btuph ----> BTU/h
-
hpi ----> Horsepower (mech)
-
hpm ----> Horsepower (metric)
temp Temperature
-
c ----> Celsius
-
f ----> Fahrenheit
-
k ----> Kelvin
data Data Size
-
b ----> B
-
kib ----> KiB
-
mib ----> MiB
-
gib ----> GiB
-
tib ----> TiB
-
kb ----> kB
-
mb ----> MB
-
gb ----> GB
-
tb ----> TB
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.