๐ป Counts the number of lines of code, written in TypeScript.
- Node.js 6+
npm install node-loc
or
yarn add node-loc
You can use node-cloc in you ternimal, or as a npm package in your projects.
Support CLOC of a file or directory.
# loc file <path>
loc file src/index.ts
# loc dir <pattern>
loc dir **/*.ts
import { LocFile, LocDir } from 'node-loc';
// for a file.
const file = new LocFile(filePath);
const { info } = file.getInfo();
// for a directory.
const dir = new LocDir(pattern);
const { info } = dir.getInfo();
- Support both command line mode and third-party package mode.
- Written in TypeScript with complete define types.
MIT License.