1.0.2 • Published 2 years ago
@muhammadfaizan59/calculator v1.0.2
@muhammadfaizan59/calculator
A simple calculator library in TypeScript.
Installation
You can install this package using npm:
npm install @muhammadfaizan59/calculator
Usage
To use the calculator functions in your TypeScript or JavaScript project, import them as follows:
const { add, sub, div, mul } = require('@muhammadfaizan59/calculator');
console.log(add(5, 3)); // Use the 'add' function
console.log(sub(10, 4)); // Use the 'sub' function
console.log(div(12, 3)); // Use the 'div' function
console.log(mul(6, 7)); // Use the 'mul' function
Available Functions
add(a: number, b: number): number - Adds two numbers.
sub(a: number, b: number): number - Subtracts the second number from the first.
div(a: number, b: number): number - Divides the first number by the second.
mul(a: number, b: number): number - Multiplies two numbers.
Examples
Here are some examples of how to use the calculator functions:
const { add, sub, div, mul } = require('@muhammadfaizan59/calculator');
console.log(add(5, 3)); // 8
console.log(sub(10, 4)); // 6
console.log(div(12, 3)); // 4
console.log(mul(6, 7)); // 42
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Muhammad Faizan - GitHub
Support and Issues
If you encounter any issues or have questions about this package, please open an issue on the GitHub repository.
Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow our contribution guidelines.
Acknowledgments
Thanks to the npm community for support and inspiration.