1.0.6 • Published 2 years ago

calculator-typescript-alanch8 v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

��## Calculator Library

For educational use

Link to npm library


Instalation

  • Use the following command to install the library in your project
npm i calculator-typescript-alanch8
  • Import the library into your project like this
import {Calculator} from 'calculator-typescript-alanch8';

Methods

add(a:number,b:number):number

addition of a and b variables (muest be numbers). returns a + b.

subs(a:number,b:number):number

substraction of a and b variables (muest be numbers). returns a - b.

multiply(a:number,b:number):number

multiplication of a and b variables (muest be numbers). returns a * b.

div(a:number,b:number):number

division of a and b variables (muest be numbers). returns a / b.

If the b variable is a zero (0) number the program will throw a math error.

How this library was built

In order to create and upload this library to Npm, we have used C-J Kihl's tutorial from Medium.

Important things to keep in mind;

  • Start the project
  • Configure it.
  • Create a build (transpile it with tsc).
  • format it and paint it with Prettier and Tlint.
  • Test it with Jest in the best case.

Once the library is finished, we create a commit and upload it to github using git push in order to continue with the steps to upload it to npm.

Let's publish the lib to npm with:

npm publish

And that's all <؉�. It's interstingt to know we can make diferent versions with:

npm version patch

Thanks for reading!


Aitor Lancharro "Alanch8" &

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago