Simple, opinionated calculator which follows the BODMAS rule built with TypeScript.
- Multiple expressions
- Handle invalid expressions gracefully
- No external dependencies or ready-made libraries for expression evaluation.
- Node.js 10+
To run this application
- First install the project dependencies with
npm install. - Run
npm run compile. - You can now call the calculator by invoking
node ./build/src/index.js YOUR_EXPRESSION_HEREor simplynode . YOUR_EXPRESSION_HERE.
This project comes with some pre-defined test that you can run with npm test. Feel free to add yours. And if you encounter a bug please submit an issue or a PR if you feel adventurous 😎 💪.
- MIT