Crates.io | lok |
lib.rs | lok |
version | 0.2.5 |
source | src |
created_at | 2019-07-03 03:11:36.075425 |
updated_at | 2024-04-15 09:26:58.507065 |
description | Count the number of codes |
homepage | https://github.com/wyhaya/lok |
repository | https://github.com/wyhaya/lok.git |
max_upload_size | |
id | 145545 |
size | 46,382 |
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 │
├──────────────────────────────────────────────────────────────────────────────┤
│ CSS 6384 9 40 108 145.89 KB │
│ HTML 19 0 0 1 1011 B │
│ JSON 205 0 0 110 13.25 KB │
│ JavaScript 206 8 1 113 590.14 KB │
│ Markdown 8 0 5 1 229 B │
│ TypeScript JSX 14733 262 800 109 530.76 KB │
│ TypeScript 680 57 57 8 22.07 KB │
│ YAML 5 0 0 1 83 B │
├──────────────────────────────────────────────────────────────────────────────┤
│ Total 22,240 336 903 451 1.27 MB │
╰──────────────────────────────────────────────────────────────────────────────╯
Download the binary from the release page
Or use cargo
to install
cargo install lok
A native package is available on NetBSD from the official repositories. To install it, simply run
pkgin install lok
A package on the AUR is also available. To install it simply run with your favorite AUR helper
paru lok
Go to your project in the terminal and type lok
on the command line
cd your-project
lok
# Change working directory
lok /root/code
# Exclude all files matched by glob
lok -e './node_modules/**'
# Exclude all files with the specified extension
lok -e '**/*.ts' '**/*.js'
# Include only files matching glob
lok -i './src/*.rs'
# Only count files containing extensions
lok --extension js ts jsx tsx
# 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
If you want to add statistics for other languages, please update config.rs
Example:
language!(
"Rust",
vec!["rs"],
vec!["//", "///"],
vec![("/*", "*/")]
);
// ...
First need to install
cargo install hyperfine loc tokei
Run
./benchmark
MIT LICENSE