belajar-bikin-package 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.
- package/index.js +16 -0
- package/package.json +12 -0
package/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const sayHello = (name) => {
|
|
2
|
+
return `Hello ${name}`;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export const sum = (numbers) => {
|
|
6
|
+
let total = 0;
|
|
7
|
+
for (const value of numbers) {
|
|
8
|
+
total += value;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return total;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const panggil = (content) => {
|
|
15
|
+
console.log(content);
|
|
16
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "belajar-bikin-package",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Belajar NodeJS NPM",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Muhamad Nur Rizki",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
}
|
|
12
|
+
}
|