calculator-api-express
v1.4.1
Published
A modular calculator API built with Express
Downloads
963
Maintainers
Readme
Calculator API Express
A lightweight REST API for mathematical operations built with Express.js
Perfect for microservices, serverless functions, or anywhere you need instant calculations.
Get Started • Documentation • Examples
Features
+ Lightning-fast arithmetic operations
+ RESTful API with query params and JSON body support
+ Zero-config setup with built-in error handling
+ Calculation history tracking
+ TypeScript readyInstallation
npm i calculator-api-expressQuick Start
const calculatorAPI = require('calculator-api-express');
const app = calculatorAPI(); //CommonJS
import calculatorAPI from 'calculator-api-express';
const app = calculatorAPI(); //module
app.listen(3000, () => {
console.log(' Calculator API running on port 3000');
});API Reference
Basic Operations
Advanced Operations
Usage Examples
GET http://localhost:3000/add?a=35&b=23GET http://localhost:3000/multiply
Content-Type: application/json
{ "a": 6, "b": 7 }GET http://localhost:3000/factorial/5POST http://localhost:3000/sumarray
Content-Type: application/json
{ "numbers": [1, 2, 3, 4, 5] }{
"result": 58,
"operation": "add"
}Built With
Links
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
MIT © Achille010
