add-four-numbers-mf 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 +29 -0
  2. package/index.js +4 -0
  3. package/package.json +12 -0
  4. package/test.js +7 -0
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Add four numbers
2
+
3
+ This module helps you add four numbers together.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install add-four-numbers-mf
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ // Load library
15
+ var addFourNumbers = require('add-four-numbers-mf');
16
+
17
+ // Calculate 0 + 1 + 2 + 3
18
+ console.log(addFourNumbers(0, 1, 2, 3)); // => 6
19
+ ```
20
+
21
+ ## Test
22
+
23
+ ```bash
24
+ npm test
25
+ ```
26
+
27
+ ## License
28
+
29
+ ISC
package/index.js ADDED
@@ -0,0 +1,4 @@
1
+ module.exports = function addFourNumbers(a, b, c, d)
2
+ {
3
+ return a + b + c + d;
4
+ };
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "add-four-numbers-mf",
3
+ "version": "1.0.0",
4
+ "description": "Function adding four numbers",
5
+ "license": "ISC",
6
+ "author": "magnusflod",
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("Tests completed!");