@umijs/linguist
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

npm version Build Status Coverage Status

@umijs/linguist

💻 Counts the number of lines of code, written in TypeScript.

Prerequisites

  • Node.js 6+

Install

npm install @umijs/linguist

or

yarn add @umijs/linguist

Usage

You can use node-cloc in you ternimal, or as a npm package in your projects.

Command line mode

Support CLOC of a file or directory.

1. file

# loc file <path>
loc file src/index.ts

loc file <path>

2. directory

# loc dir <pattern>
loc dir **/*.ts

loc dir <pattern>

Third-party mode(in TypeScript)

import { LocFile, LocDir } from '@umijs/linguist';

// for a file.
const file = new LocFile(filePath);
const { info } = file.getInfo();

//  for a directory.
const dir = new LocDir(pattern);
const { info } = dir.getInfo();

Features

  • Support both command line mode and third-party package mode.
  • Written in TypeScript with complete define types.

License

MIT License.

Package Sidebar

Install

npm i @umijs/linguist

Weekly Downloads

14

Version

1.0.1

License

MIT

Unpacked Size

440 kB

Total Files

149

Last publish

Collaborators

  • yifankakaxi
  • xierenyuan
  • stormslowly
  • xiefengnian
  • sorrycc
  • chenshuai2144
  • kuitos
  • peachscript
  • xiaohuoni