A naive package exposing very basic math operations.
Obviously, this package is not intended for usage! Stick with JS for this kind of stuff LOL.
It's just personal training on some basic stuff, like:
- setup an NPM module
- execute commands via CLI
- practice with node-tap
npm install naive-calculator
or
yarn add naive-calculator
const calculator = require("naive-calculator");
// ...
const sum = calculator.sum(1, 2, 3);
const difference = calculator.substract(1, 2, 3);
const product = calculator.multiply(1, 2, 3);
const { quotient, remainder } = calculator.divide(10, 3);
yarn calculate [sum | substraction | multiply | divide] 1 2 3
Run all tests with:
yarn test
For coverage report run:
yarn test --coverage-report=html