npm: Count lines of code

Run npx cloc [options] <files/dirs>. E.g. npx cloc src/ or npx cloc foo.js bar.css.

The cloc npm package by Kent C. Dodds is a wrapper around the cloc command line program by Al Danial.

Example from this repo:

$ npx cloc . \
--exclude-dir=_sample-content,_site,node_modules \
--not-match-f=package-lock.json

npx: installed 1 in 1.251s
105 text files.
104 unique files.
32 files ignored.

github.com/AlDanial/cloc v 1.88 T=0.14 s (707.0 files/s, 53332.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Markdown 50 865 0 3943
JavaScript 22 105 106 803
Pug 16 83 124 701
CSS 1 33 31 311
JSON 2 0 0 62
TOML 1 4 0 26
YAML 1 2 2 12
XML 1 0 0 8
Bourne Shell 1 4 9 7
SVG 1 0 0 1
-------------------------------------------------------------------------------
SUM: 96 1096 272 5874
-------------------------------------------------------------------------------