npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-stat-viewer

v1.0.2

Published

Git 代码提交量统计工具

Readme

git-stat-viewer Build Status npm package

Git 代码提交量统计工具,支持命令行和视图操作

功能概览

  • [x] 代码行数统计
  • [x] 文件格式美化
  • [x] 计算总行数
  • [x] 添加日期限制
  • [x] 支持分支切换
  • [x] 封装命令行工具
  • [ ] 视图操作

快速上手

  1. 全局安装
npm i git-stat-viewer -g
  1. 执行统计

node >= v8.9环境中,执行

gitstat g/generate [配置文件/git仓库地址/git本地仓库目录] [结果输出文件]

指定统计时间

gitstat g/generate [配置文件/git仓库地址/git本地仓库目录] [结果输出文件] --since YYYY-MM-DD --until YYYY-MM-DD

--since 可简写成 -s--until 可简写成 -u

执行完成之后,在 git-stat/dist.md 中查看统计结果

一个将输出结果在typora中展示的🌰:

user name | added lines | removed lines | total lines ---- | --- | --- | --- Ling | 354 | 55 | 299 Ling Z | 1024 | 99 | 925

  1. 清除缓存
# 清除本地缓存的git仓库
gitstat clear
# 同时清除输出的结果文件
gitstat clear --all

配置说明

config.json/yaml中,有如下参数可定义:

param | type | comment ---- | --- | --- repositories | Array | Git仓库信息 repositories[i].address | String | Git远程仓库地址 repositories[i].branch | String | Git分支 since | String | 统计的开始时间,格式YYYY-MM-DD until | String | 统计的结束时间,格式YYYY-MM-DD distFile | String | 输出的文件名,默认dist.md

License

MIT