Skip to content
创建日期: 2026-06-11 22:32:18
最后更新: 2026-06-11 22:32:18
修订次数: 1

获取文件Git时间戳

依赖

  • node:fs
  • node:path
  • node:child_process

权限

  • 执行命令

介绍

获取指定文件从创建到最后修改的所有 Git 提交时间戳

使用

ts
// 示例

import getFileGitTimestamps from './utils/<dir>/get-file-git-timestamps'

const timestamps = await getFileGitTimestamps("./doc.md");

Released under the MIT License.