Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/lokPublic

Count the number of codes

License

NotificationsYou must be signed in to change notification settings

wyhaya/lok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Workflow StatusCrates.ioLICENSE

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 │╰──────────────────────────────────────────────────────────────────────────────╯

Features

  • Quickly calculate data
  • Support multiple languages
  • Support multiple output formats, ASCII, HTML, Markdown

Install

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

Use

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

Contributing

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

Example:

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

Benchmark

First need to install

cargo install hyperfine loc tokei

Run

./benchmark

License

MIT LICENSE


[8]ページ先頭

©2009-2025 Movatter.jp