hlog-cli
v1.0.9
Published
该项目用于替代git log命令,使用起来更加简洁。
Readme
安装方法
局部安装:npm i hlog-cli -D
全局安装:npm i -g hlog-cli
使用方法
// 该工具用于查询git仓库的提交记录
const logInstance = require("hlog-cli");
// 获取仓库提交记录
logInstance.getDetail({
line: 50, // 查询行数
word: "张三", // 查询关键词
execPath: 'D:\myProject', // 项目本地路径
}).then(logs => {
console.log(logs);
});
/*
[
{
commiter: 'zhangsan',
hash: 'asdsff33',
msg: '初始化',
date: '2025-03-20 12:09:00'
}
]
*/
// 获取全部提交记录
logInstance.getAllLogs({
execPath: 'D:\myProject', // 项目本地路径
}).then(logs => {
console.log(logs);
});全局命令行使用方式
hlog --line=50 --word=zhangsan