{"id":13726822,"url":"https://github.com/wyhaya/lok","last_synced_at":"2025-05-07T00:34:53.843Z","repository":{"id":34049754,"uuid":"166340001","full_name":"wyhaya/lok","owner":"wyhaya","description":"Count the number of codes","archived":false,"fork":false,"pushed_at":"2024-04-15T09:26:23.000Z","size":27,"stargazers_count":50,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T12:45:32.026Z","etag":null,"topics":["codes","command-line-tool","count","count-lines","count-lines-of-code"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wyhaya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-18T03:48:11.000Z","updated_at":"2025-01-21T07:43:44.000Z","dependencies_parsed_at":"2024-01-07T21:04:51.992Z","dependency_job_id":null,"html_url":"https://github.com/wyhaya/lok","commit_stats":{"total_commits":8,"total_committers":5,"mean_commits":1.6,"dds":0.625,"last_synced_commit":"6a096de1e6216a1d40c9f1f78cce4ac815a01cac"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyhaya%2Flok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyhaya%2Flok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyhaya%2Flok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyhaya%2Flok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyhaya","download_url":"https://codeload.github.com/wyhaya/lok/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250972269,"owners_count":21516317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codes","command-line-tool","count","count-lines","count-lines-of-code"],"created_at":"2024-08-03T01:03:25.197Z","updated_at":"2025-05-07T00:34:53.822Z","avatar_url":"https://github.com/wyhaya.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\n\n# lok\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/wyhaya/lok/ci.yml?style=flat-square\u0026branch=main)](https://github.com/wyhaya/lok/actions)\n[![Crates.io](https://img.shields.io/crates/v/lok.svg?style=flat-square)](https://crates.io/crates/lok)\n[![LICENSE](https://img.shields.io/crates/l/lok.svg?style=flat-square)](https://github.com/wyhaya/lok/blob/master/LICENSE)\n\n`lok` is a command line tool, that is used to quickly calculate the number of lines of various language codes in a project\n\n```\n╭──────────────────────────────────────────────────────────────────────────────╮\n│ Language              Code     Comment       Blank        File          Size │\n├──────────────────────────────────────────────────────────────────────────────┤\n│ CSS                   6384           9          40         108     145.89 KB │\n│ HTML                    19           0           0           1       1011 B  │\n│ JSON                   205           0           0         110      13.25 KB │\n│ JavaScript             206           8           1         113     590.14 KB │\n│ Markdown                 8           0           5           1        229 B  │\n│ TypeScript JSX       14733         262         800         109     530.76 KB │\n│ TypeScript             680          57          57           8      22.07 KB │\n│ YAML                     5           0           0           1         83 B  │\n├──────────────────────────────────────────────────────────────────────────────┤\n│ Total               22,240         336         903         451       1.27 MB │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n\n## Features\n\n* Quickly calculate data\n* Support multiple languages\n* Support multiple output formats, ASCII, HTML, Markdown\n\n## Install\n\n[Download](https://github.com/wyhaya/lok/releases) the binary from the release page\n\nOr use `cargo` to install\n\n```bash\ncargo install lok\n```\n\nA native package is available on NetBSD from the official repositories.\nTo install it, simply run\n\n```bash\npkgin install lok\n```\n\nA package on the AUR is also available. To install it simply run with your favorite AUR helper\n\n```bash\nparu lok\n```\n\n## Use\n\nGo to your project in the terminal and type `lok` on the command line\n\n```bash\ncd your-project\nlok\n\n# Change working directory\nlok /root/code\n```\n\n```bash\n# Exclude all files matched by glob\nlok -e './node_modules/**'\n\n# Exclude all files with the specified extension\nlok -e '**/*.ts' '**/*.js'\n```\n\n```bash\n# Include only files matching glob\nlok -i './src/*.rs'\n```\n\n```bash\n# Only count files containing extensions\nlok --extension js ts jsx tsx\n```\n\n```bash\n# Output other formats: table, html, markdown\nlok -o markdown\n\n# Save to file\nlok -o html \u003e code.html\nlok -o markdown \u003e code.md\n```\n\n```bash\n# Sort by: language, code, comment, blank, file, size\nlok -s code\n```    \n \n## Contributing\n\nIf you want to add statistics for other languages, please update [config.rs](./src/config.rs)\n\nExample:\n\n```rust\nlanguage!(\n    \"Rust\", \n    vec![\"rs\"], \n    vec![\"//\", \"///\"], \n    vec![(\"/*\", \"*/\")]\n);\n// ...\n```\n\n## Benchmark\n\nFirst need to install\n\n```bash\ncargo install hyperfine loc tokei\n```\n\nRun\n\n```bash\n./benchmark\n```\n\n## License\n\n[MIT](./LICENSE) LICENSE\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyhaya%2Flok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyhaya%2Flok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyhaya%2Flok/lists"}