Metaunit is NPM package for unit conversion.
npm i metaunit
const unit = require('metaunit');
const cm_to_mm = unit.centimeters_to_millimeters(1);
console.log(cm_to_mm);
const unit = require('metaunit')
const kg_to_g = unit.kilograms_to_grams(20)
console.log(kg_to_g);
const unit = require('metaunit')
const l_to_ml = unit.liters_to_milliliters(5)
console.log(l_to_ml);
metaunit will convert you metric values. You only have to pass the desired unit values inside as parameter of the method.
If you are trying to convert metric values use metaunit
centimeters to millimeters
decimeters to entimeters
meters to centimeters
meters to decimeters
kilometers to meters
square centimeters to square millimeters
square meters to square centimeters
hectares to square meters
square Meters to hectares
square Kilometers to square Meters
cubic centimeters to cubic millimeters
cubic decimeters to cubic centimeters
cubic meters to cubic centimeters
cubic meters to cubic decimeters
grams to milligrams
decagrams to grams
kilograms to grams
tonnes to kilograms
gigagrams to megagrams
centiliters to milliliters
deciliters to centiliters
liters to milliliters
liters to deciliters
kiloliters to liters
bytes to bit
kilobyte to byte
megabyte to kilobytes
gigabyte to megabytes
terabytes to gigabyte
petabytes to terabyte
exabyte to petabytes
zettabyte to exabytes
yottabyte to zettabytes