当前位置: 首页 > 后端技术 > Node.js

统计指定目录下的代码行数

时间:2023-04-04 00:49:15 Node.js

codeLineCount是一个用于统计项目中代码行数的工具。安装$npminstall-gcode-rows-countor$yarnglobaladdcode-rows-countUsage$codeLineCount-hUsage:codeLineCount[options]Options:-V,--versionoutputtheversionnumber-p,--filePath[filePath]文件路径-i,--ignoreFile[ignoreFile]忽略文件-h,--help输出使用信息-p:required统计代码行数的项目的绝对路径-i:统计代码行数的项目中的文件名不需要参与统计,多个文件名用逗号分隔示例:$codeLineCount-p/home/silence/nodejs/test-inode_modules,yarn.lock,.git,package.json.lock文件路径:/home/silence/nodejs/test/color.js,文件行数:19文件路径:/home/silence/nodejs/test/commander.js,文件行数:14文件路径:/home/silence/nodejs/test/http.js,文件行数:6文件路径:/home/silence/nodejs/test/package.json,文件行数:6文件路径:/home/silence/nodejs/test/aaa/color。js,文件行数:19------------------分割线开始-----------------done,total耗时:5ms文件总数:5,代码行总数:64-----------------分割线结束-------------------