0.0.3 • Published 3 years ago
naive-calculator v0.0.3
Naive Calculator
A naive package exposing very basic math operations.
Disclaimer
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
Setup
npm install naive-calculatoror
yarn add naive-calculatorUsage
In another JS project
const calculator = require("naive-calculator");
// ...
const sum = calculator.sum(1, 2, 3);
const difference = calculator.substraction(1, 2, 3);
const product = calculator.multiply(1, 2, 3);
const { quotient, remainder } = calculator.divide(10, 3);Via CLI
yarn calculate [sum | substraction | multiply | divide] 1 2 3Tests
Run all tests with:
yarn testFor coverage report run:
yarn test --coverage-repost=html