ksw-calculator 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +8 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,8 @@
1
+ // index.js
2
+ module.exports.add = (a, b) => a + b;
3
+ module.exports.subtract = (a, b) => a - b;
4
+ module.exports.multiply = (a, b) => a * b;
5
+ module.exports.divide = (a, b) => {
6
+ if (b === 0) throw new Error("Cannot divide by zero");
7
+ return a / b;
8
+ };
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "ksw-calculator",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "ksw9722",
11
+ "license": "ISC"
12
+ }