@nameisrohan/rohancalc 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 (3) hide show
  1. package/README.md +8 -0
  2. package/add.js +5 -0
  3. package/package.json +13 -0
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ This is basic additon for n number of numbers that you pass as parameter to the add function.
2
+
3
+ Example:
4
+
5
+ ```
6
+ rohancalc.add(9, 10, 99)
7
+ rohancalc.add(2, 20, 9, 45, 362, 78)
8
+ ```
package/add.js ADDED
@@ -0,0 +1,5 @@
1
+ export const rohancalc = {
2
+ add : function(...numbers){
3
+ return numbers.reduce((acc, cur)=> acc + cur, 0);
4
+ }
5
+ }
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@nameisrohan/rohancalc",
3
+ "version": "1.0.0",
4
+ "main": "add.js",
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "description": ""
13
+ }