{"_id":"@calfzhou/hexo-update-time","name":"@calfzhou/hexo-update-time","dist-tags":{"latest":"1.1.3"},"versions":{"1.1.3":{"name":"@calfzhou/hexo-update-time","version":"1.1.3","description":"配合 `lint-staged`, `husky` 插件自动在提交前自动更新 `date` 和 `updated` 字段","type":"module","bin":{"hexo-update-time":"bin/hexo-update-time.js"},"main":"src/index.js","scripts":{"dev":"node bin/hexo-update-time.js"},"keywords":["hexo","git"],"author":{"name":"par9uet","email":"1607611087@qq.com"},"license":"ISC","dependencies":{"commander":"^12.1.0","dayjs":"^1.11.12","execa":"^9.3.0"},"publishConfig":{"access":"public"},"gitHead":"a3611a0a248f3f17f759c050d09b5dd980709e31","_id":"@calfzhou/hexo-update-time@1.1.3","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-4lTtDuGCbIEvSYfFkSZHe1oGoL0XaYS/853SbSQAg0kanyZFlxebiTB9M5l6xaCWtR16HtzEz1na1qNNifrG8A==","shasum":"4255851af8f3726e55ade77938018b19e774c166","tarball":"https://registry.npmjs.org/@calfzhou/hexo-update-time/-/hexo-update-time-1.1.3.tgz","fileCount":7,"unpackedSize":4296,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCBx9OM+LFPsdhKRNn95u6F8SieERI+V5ClfWyaganBUgIhAMEcxM6ACd5hUGCqcltNcNIY3gJjp0T+0HTQjF98rT5J"}]},"_npmUser":{"name":"calfzhou","email":"calf.zhou@gmail.com"},"directories":{},"maintainers":[{"name":"calfzhou","email":"calf.zhou@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hexo-update-time_1.1.3_1775481450989_0.9879523593028539"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-06T13:17:30.906Z","1.1.3":"2026-04-06T13:17:31.148Z","modified":"2026-04-06T13:17:31.389Z"},"maintainers":[{"name":"calfzhou","email":"calf.zhou@gmail.com"}],"description":"配合 `lint-staged`, `husky` 插件自动在提交前自动更新 `date` 和 `updated` 字段","keywords":["hexo","git"],"author":{"name":"par9uet","email":"1607611087@qq.com"},"license":"ISC","readme":"# Hexo-update-time\n\n配合 `lint-staged`, `husky` 插件自动在提交前自动更新 `date` 和 `updated` 字段\n\n安装依赖\n\n```text\nnpm install @calfzhou/hexo-update-time lint-staged husky\n```\n\n执行\n\n```\nnpx husky install\n```\n\n确保 `git` 钩子生效\n\n执行\n\n```\nnpx husky add .husky/pre-commit \"npm run lint-staged\"\n```\n\n添加 `pre-commit` 钩子\n\n`package.json` 中添加 `lint-staged` 的 `script` 和相应配置\n\n```json\n{\n  // ...\n  \"script\": {\n    // ...\n    \"lint-staged\": \"lint-staged\"\n  },\n  \"lint-staged\": {\n    \"source/_posts/*.md\": \"hexo-update-time\"\n  }\n}\n```\n\n如果为第一次提交，那么 `date` 和 `updated` 会统一更新到当前时间\n\n否则只有 `updated` 会更新到 ~~当前时间~~ 文件的最后修改时间\n","readmeFilename":"README.md","_rev":"1-662c81912e07bdbff041a86252733490"}