2.0.0 • Published 2 years ago

@licq/git v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@licq/git

封装一些操作 git 信息的方法

NPM version NPM downloads

安装

npm i --save-dev @licq/git

API

getGitUserInfo

获取当前仓库的Git用户信息

Returns: Object
Since: v1.0.0
Example

const git = require('@licq/git')
const res = git.getGitUserInfo()
//==> eg: { userName: 'ostwindli', userEmail: 'ostwindli@tencent.com' }

getGitChangelog

根据git项目,生成对应的changelog的markdown内容

Returns: String
Since: v2.0.0

ParamTypeDescription
ParamsObject参数
Params.gitProjectPathStringgit项目路径 必填 eg:"/Users/xxx/asenal"
Params.gitCommitRepoStringgit项目仓库提交路径 必填 eg: "https://github.com/ostwindli/asenal/commit"
Params.titleArrayArray | undefined生成的changlog头信息 可选 eg:'# 更新日志', '更新内容简介xxx'
Params.markdownFileString | undefined生成的markdown文件路径 可选 eg:"/Users/xxx/asenal/CHANGELOG.md"

Example

const git = require('@licq/git')
const res = git.getGitChangelog({
    gitProjectPath: __dirname,
    gitCommitRepo: 'https://github.com/ostwindli/asenal/commit',
    titleArray: ['# 更新日志', '\n这是一个测试changelog'],
    markdownFile: '/Users/xxx/asenal/CHANGELOG.md'
})x
//==> eg: https://mpqq.gtimg.cn/ost/asenal/changelog_demo.png
2.0.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago