- Notifications
You must be signed in to change notification settings - Fork6
wyhaya/lok
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 │╰──────────────────────────────────────────────────────────────────────────────╯
- Quickly calculate data
- Support multiple languages
- Support multiple output formats, ASCII, HTML, Markdown
Download the binary from the release page
Or usecargo
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 typelok
on the command line
cd your-projectlok# Change working directorylok /root/code
# Exclude all files matched by globlok -e'./node_modules/**'# Exclude all files with the specified extensionlok -e'**/*.ts''**/*.js'
# Include only files matching globlok -i'./src/*.rs'
# Only count files containing extensionslok --extension js ts jsx tsx
# Output other formats: table, html, markdownlok -o markdown# Save to filelok -o html> code.htmllok -o markdown> code.md
# Sort by: language, code, comment, blank, file, sizelok -s code
If you want to add statistics for other languages, please updateconfig.rs
Example:
language!("Rust", vec!["rs"], vec!["//","///"], vec![("/*","*/")]);// ...
First need to install
cargo install hyperfine loc tokei
Run
./benchmark
MIT LICENSE
About
Count the number of codes