The Conversion App was created as a simple place to find unit conversions without scouring the internet for a decent solution. As well as providing conversions, this system will explain the equations used for the conversion in a clear and logical manner.
Initially this application will provide basic conversions for a few different types of units, however this project aims to be expanded in the future to cover more areas. Table 1 shows the types of unit conversions that are planned to be added and the current work status of those features.
Unit type | Current status |
---|---|
Distances | Initial version (v0.2.0) |
Mass | Initial version (v0.1.0) |
Speed | Planning stage |
Binary | Proposed |
Memory (Mb) | Proposed |
Internet speed | Proposed |
Currency | API investigation |
Temperature | Proposed |
Table 1 - Proposed unit conversions to be added.
The method for making conversions is to convert the input into a base unit, like a kilogram and then convert this base unit into the users desired unit. For example, the user might input 120lb which they want converted to tonnes. This would be converted from pounds to kilograms and then from kilograms to tonnes.
The base units for each type of conversion can be seen in Table 2.
Unit type | Base unit |
---|---|
Distances | Meters |
Mass | Kilograms |
Table 2 - The common base units for each conversion type.
To get started with this application, you will first need to download all the necessary dependencies for the project using the following command:
npm i
Once downloaded, you can then launch the application using the start command:
npm start
This application has been setup with Jest testing to ensure that code can be quickly checked for defects against its functionality when new content is added. The test suite can be launched using the following npm command:
npm test
The following should be taken into account when making changes to this repo:
A production version of this application is now live, hosted using GitHub pages. To facilitate this, the application is setup with the gh-pages npm extension.
Pushing new version to the gh-pages branch, two scripts have been setup, a deploy and a pre-deploy. All that is needed to push to this branch is the deploy command.
npm run predeploy
npm run deploy
The production version can be viewed at: https://matthewnobes.github.io/conversion-app/