chil-add-four-numbers 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 (4) hide show
  1. package/README.md +22 -0
  2. package/index.js +3 -0
  3. package/package.json +12 -0
  4. package/test.js +7 -0
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Add four numbers
2
+
3
+ This module helps you to add four numbers.
4
+
5
+ ## Install
6
+
7
+ npm install add-four-numbers
8
+
9
+ ## USAGE
10
+ **`addFourNumbers(a, b, c, d)`**
11
+
12
+ // Load library
13
+ var addFourNumbers = require('add-four-numbers');
14
+
15
+ // Calculate 0 + 1 + 2 + 3
16
+ console.log(addFourNumbers(0, 1, 2, 3)); // => 6
17
+
18
+ ## Test
19
+
20
+ npm test
21
+
22
+ License ISC
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ module.exports = function addFourNumbers(a, b, c, d) {
2
+ return a + b + c + d;
3
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "chil-add-four-numbers",
3
+ "version": "1.0.0",
4
+ "description": "\"Function adding four numbers\"",
5
+ "license": "ISC",
6
+ "author": "kris_chil",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "test": "node test.js"
11
+ }
12
+ }
package/test.js ADDED
@@ -0,0 +1,7 @@
1
+ var assert = require('assert');
2
+ var addFourNumbers = require('./index');
3
+
4
+ assert.strictEqual(addFourNumbers(0, 1, 2, 3), 6);
5
+ assert.strictEqual(addFourNumbers(3, 2, 1, 0), 6);
6
+
7
+ console.log("Test completed!");