cishu-data-format 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/LICENSE +0 -0
- package/README.md +29 -0
- package/package.json +30 -0
- package/src/index.js +20 -0
package/LICENSE
ADDED
|
File without changes
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# cishu-data-format
|
|
2
|
+
|
|
3
|
+
辞书处理数据集合 NPM 包的 Demo。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install cishu-data-format
|
|
9
|
+
|
|
10
|
+
##
|
|
11
|
+
# 1. 在项目根目录初始化(如果还没做)
|
|
12
|
+
npm init -y
|
|
13
|
+
|
|
14
|
+
# 2. 登录 npm
|
|
15
|
+
npm login
|
|
16
|
+
|
|
17
|
+
# 3. 验证是否登录成功
|
|
18
|
+
npm whoami
|
|
19
|
+
# 发布(第一次用这个)
|
|
20
|
+
npm publish --access public
|
|
21
|
+
# 修改版本号(推荐方式)
|
|
22
|
+
npm version patch # 1.0.0 -> 1.0.1
|
|
23
|
+
# 或
|
|
24
|
+
npm version minor # 1.0.0 -> 1.1.0
|
|
25
|
+
# 或
|
|
26
|
+
npm version major # 1.0.0 -> 2.0.0
|
|
27
|
+
|
|
28
|
+
# 然后发布
|
|
29
|
+
npm publish
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cishu-data-format",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "辞书处理xml数据格式的工具库",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"cishu",
|
|
12
|
+
"xml",
|
|
13
|
+
"data-format",
|
|
14
|
+
"dictionary",
|
|
15
|
+
"toolkit"
|
|
16
|
+
],
|
|
17
|
+
"author": "Ginga",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/bestPrunce/cishu-data-format.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/bestPrunce/cishu-data-format/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/bestPrunce/cishu-data-format#readme",
|
|
27
|
+
"files": [
|
|
28
|
+
"src"
|
|
29
|
+
]
|
|
30
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一个简单的问候函数
|
|
3
|
+
* @param {string} name - 名字
|
|
4
|
+
* @returns {string} 问候语
|
|
5
|
+
*/
|
|
6
|
+
export function greet(name = '世界') {
|
|
7
|
+
return `你好,${name}!欢迎使用我的第一个 NPM 包 🎉`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 加法函数(测试用)
|
|
12
|
+
*/
|
|
13
|
+
export function add(a, b) {
|
|
14
|
+
return a + b;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
greet,
|
|
19
|
+
add
|
|
20
|
+
};
|