# CodeCounter **Repository Path**: onlyyyy/code-counter ## Basic Information - **Project Name**: CodeCounter - **Description**: 用Nodejs实现一个代码量统计工具 - **Primary Language**: NodeJS - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 0 - **Created**: 2021-03-23 - **Last Updated**: 2022-07-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CodeCounter ## 介绍 用Nodejs实现一个代码量统计工具 ## 使用方式 命令: ```shell ./CodeCounter [path] [pre-config] ``` path是需要统计代码量的根目录 pre-config目前支持: -node: 过滤node_modules文件夹,LICENSE文件,.gitignore文件 .git文件夹 -cpp: 过滤exe -all: 不过滤任何内容 ## 配置文件 如果不输入`[pre-config]`可以使用配置文件的方式进行忽略 文件名放在程序的目录下,命名为 ignore.json 内容: ```json { ".gitignore": true, "node_modules": true, ".git": true, "LICENSE": true } ``` 过滤key,后面的value可以随意填写。 ## 运行结果示例 ```c counting /Users/jyding/Desktop/codes/code-counter/ignore.json counting /Users/jyding/Desktop/codes/code-counter/package-lock.json Code count result is 217 ``` ## 总结 一个简单的小工具,编程就是应该写自己喜欢的东西。