rocky_calculator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +22 -0
  2. package/package.json +27 -0
package/index.js ADDED
@@ -0,0 +1,22 @@
1
+ function add(a,b) {
2
+ return a+b;
3
+ }
4
+
5
+ function subtract (a,b){
6
+ return a-b;
7
+ }
8
+
9
+ function multiply (a,b){
10
+ return a*b;
11
+ }
12
+
13
+ function divide (a,b){
14
+ if(b ===0) throw new Error('Cannot divide by zero');
15
+ return a/b;
16
+ }
17
+
18
+ function power(a,b) {
19
+ return Math.pow(a,b);
20
+ }
21
+
22
+ module.exports = { add, subtract, multiply, divide, power };
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "rocky_calculator",
3
+ "version": "1.0.0",
4
+ "description": "small calculator package",
5
+ "keywords": [
6
+ "rocky",
7
+ "calc"
8
+ ],
9
+ "homepage": "https://github.com/rockyishimwe/stanleygithub#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/rockyishimwe/stanleygithub/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/rockyishimwe/stanleygithub.git"
16
+ },
17
+ "license": "MIT",
18
+ "author": "Rocky",
19
+ "type": "commonjs",
20
+ "main": "index.js",
21
+ "scripts": {
22
+ "test": "echo \"Error: no test specified\" && exit 1"
23
+ },
24
+ "dependencies": {
25
+ "marius_package": "^1.0.0"
26
+ }
27
+ }