-
Notifications
You must be signed in to change notification settings - Fork 16
/
sloc.javascript_cli.txt
50 lines (42 loc) · 3.68 KB
/
sloc.javascript_cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
SLOC
VERSION ==> #0.2.0
#Count of number of lines
#Nodejs, javascript, CLI
LANGUAGES ==> #Supports lots of different languages.
#Does not parse files, just do string searches using language-specific REGEXPs for
#single-line comments and block comments.
SLOC('CODE', 'EXT')->SLOC_RET #Returns SLOC_RET:
# - total NUM: physical lines of codes
# - empty NUM: empty lines
# - mixed NUM: single-line comments, mixed with code
# - single NUM: single-line comments, mixed or not with code
# - block NUM: number of lines occupied by block comments
# - comment NUM: single + block
# - todo NUM: TODO comments
# - source NUM: total - empty - (comment - mixed)
WINDOW.sloc(...) #Same but in browser
sloc FILE|DIR #Same as CLI
--exclude REGEXP #Exclude files
--alias EXT2=EXT #Add support for other file extensions
#By def, uses file extension to guess type
--keys KEY,... #Only includes SLOC_RET[KEY]
--format FORMATTER #Among:
# - simple (def)
# - cli-table:
# - FORMATTER_OPTS: no-head BOOL (def: false)
# - csv
# - json:
# - outputs:
# - summary SLOC_RET (for all files)
# - files OBJ_ARR: path 'PATH', stats SLOC_RET, badFile BOOL
# - byExt.EXT.summary|files (same but grouped by EXT)
# - FORMATTER_OPTS: no-indent BOOL (def: false)
#Custom formatters are FUNC(SLOC_RET, OPTS, FORMATTER_OPTS)
--format-option VAL,... #
--details #Gives results by file, according to formatter:
# - simple|csv by def gives result for all files
# - cli-table by def gives result by EXT
# - json by def already gives result by file
--strip-colors #