1.0.3 • Published 3 years ago
conversion-package v1.0.3
Conversion-Package
Introduction:
In this package there are conversion functions written in javascript. The functions can convert "unit of length" and also "Scale of temperature". The functions perform conversions based on an argument that the user enters. It is written in a short and efficient way.
arguments:
- "cm" = The argument input will be
inchand the output will becentimeter. - "inch" = The argument input will be
centimeterand the output will beinch. - "Tc" = The argument input will be
fahrenheitand the output will becelsius. - "Tf" = The argument input will be
celsiusand the output will befahrenheit.
Example:
"Converts centimeter to inch":
function cm_to_inch(cm){
let inch = cm / 2.54;
console.log(`The result is:`);
console.log(`cm: ${cm} ===` + ` inch: ${inch}`);
}
cm_to_inch(13); // The result is:
cm: 13 === inch: 5.118110236220472Exports:
module.exports = {
inch_to_cm,
cm_to_inch,
fahrenheit_to_celsius,
celsius_to_fahrenheit
}How to use:
- installing -
npm install conversion-package- using -
const package = require('conversion-package');
package.name of the function(appropriate argument);