lok 0.0.8

Calculation code information
lok-0.0.8 is not a library.

lok

GitHub Workflow Status Crates.io LICENSE

lok is a command line tool, that is used to quickly calculate the number of lines of various language codes in a project

┌──────────────────────────────────────────────────────────────────────────────┐
| Language              Code     Comment       Blank        File          Size |
├──────────────────────────────────────────────────────────────────────────────┤
| HTML                   360           0          27          13      24.97 KB |
| JavaScript             238         240          79          22     935.95 KB |
| JavaScript JSX       26570        2011        4096         299     766.10 KB |
| JSON                    81           0           3           4       1.97 KB |
| Markdown                31           0          13           1      882.00 B |
| TypeScript              57           6          12           3       3.78 KB |
| TypeScript JSX         691          78          46          10      19.12 KB |
| YML                      4           0           0           1       58.00 B |
├──────────────────────────────────────────────────────────────────────────────┤
| Total               28,032       2,335       4,276         353       1.71 MB |
└──────────────────────────────────────────────────────────────────────────────┘

Features

  • Quickly calculate data
  • Support multiple languages
  • Support multiple outputs, ASCII, HTML, Markdown

Install

Download the binary from the release page

Or use cargo to install

cargo install lok

Use

Go to your project in the terminal and type lok on the command line

cd your-project
lok

# Change working directory
lok /root/code
# If you want to calculate some languages
lok -ext ts js
# If you want to ignore files
lok -e './node_modules/**'

# Ignore all files with the specified extension
lok -e '**/*.ts' '**/*.js'
# If you want to output other formats: table, html, markdown
lok -o markdown

# Save to file
lok -o html > code.html
lok -o markdown > code.md
# Sort by: language, code, comment, blank, file, size
lok -s code

Contributing

If you want to add statistics for other languages, please update config.rs

Example:

language!(
    "Rust", 
    vec!["rs"], 
    vec!["//", "///"], 
    vec![("/*", "*/")]
);
// ...

Benchmark

First need to install

cargo install hyperfine loc tokei

Run

./benchmark

License

MIT LICENSE