0.0.3 • Published 1 year 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-calculator
or
yarn add naive-calculator
Usage
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 3
Tests
Run all tests with:
yarn test
For coverage report run:
yarn test --coverage-repost=html