1.0.3 • Published 1 year ago

conversion-package v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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 inch and the output will be centimeter.
  • "inch" = The argument input will be centimeter and the output will be inch.
  • "Tc" = The argument input will be fahrenheit and the output will be celsius.
  • "Tf" = The argument input will be celsius and the output will be fahrenheit.

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.118110236220472

Exports:

module.exports = {
    inch_to_cm,
    cm_to_inch,
    fahrenheit_to_celsius,
    celsius_to_fahrenheit
}

How to use:

  1. installing -
 npm install conversion-package
  1. using -
const package = require('conversion-package');
package.name of the function(appropriate argument);