Convertis
Intro
Convertis is a NodeJS module that let's you convert 'anything'. Never write your own convert functions again! Here you will get some convert functions like:
- Temperature (Celsius, Fahrenheit, Kelvin)
- Weight (Grams, Kilograms, Tons, Pounds, Ounces)
- Measurement (Millimeters, Centimeters, Meters, Kilometers, Inches, Feets, Yards, Miles)
- DataSize (Bytes, Kilobytes, Megabytes, Terabytes, Petabytes, Exabytes, Zetabytes, Yottabytes)
- Time (Milliseconds, Seconds, Minutes, Hours)
- Volume (Millilitre, Centilitre, Decilitre, Litre)
More information in the wiki on github.
See the change log for update news.
Install
npm install convertis
Usage
var Convertis = ; //Import the module.var c = ; //Create an instance of Convertis //temperature examplesconsole; //returns 10 kelvin in celsius: -263.15console; //returns 1 celsius in kelvin: 274.15console; //returns 10 fahrenheit in celsius -12.222222222222221 //weight exampleconsole; //returns 10000 grams in kilograms: 10console; //returns 10000 grams in ounces: 352.7396195console; //returns 10000 tons in grams: 10000000000console; //returns 10000 pounds in kilograms: 4535.9237 //measurement exampleconsole; //return 100 millimeters in centimeters: 10console; //return 100 meters in miles: 0.0621371192console; //return 100 inches in feets: 8.33333333 //data size exampleconsole; //returns 1 bytes in kilobytes: 0.0009765625console; //returns 1 kilobytes in bytes: 1024console; //returns 1 gigabytes in megabytes: 1024console; //returns 1 yottabytes in terabytes: 1099511627776 //time exampleconsole; //returns 3 hours in minutes: 180console; //returns 3 minutes in milliseconds: 180000console; //returns 3 milliseconds in seconds: 0.003 //Volume exampleconsole; //returns 10 Centilitre in Millilitre: 100console; //returns 10 Litre in Centilitre: 1000console; //returns 10 Decilitre in Litre: 1
Testing
If you want to try some functions before using this module
in your application you can use the test.js
file located in the
root folder of the module and then run the file in your terminal with the command
node ./test.js
or run npm test
from the module folder.
License
ISC - © Copyright Mikael Luxwarp Carlsson
Note/Contribute
Feel free to contribute the way you want.