Skip to content

Navigation Menu

Sign in
Appearance settings

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
Appearance settings

Releases: Moderrek/lines

v1.2.0 - Refactored Architecture with Library Support

24 May 16:49
@Moderrek Moderrek

Choose a tag to compare

v1.2.0 - Refactored Architecture with Library Support

Overview

This release marks a significant milestone with a complete project restructuring that transforms lines into both a powerful CLI tool and a reusable Go library. Major improvements include configurable buffer management, JSON output support, and automated multi-platform builds.

Major Changes

Refactored Project Structure

  • Separated CLI logic from core functionality into cmd/lines and pkg/lines directories
  • The core line counting engine is now available as a public library at github.com/moderrek/lines/pkg/lines
  • Improved code organization for better maintainability and reusability

New Features

  • JSON output support: Use --json flag to output results in machine-readable format
  • Configurable buffer sizes: Users can now customize scanner buffer initial and maximum sizes through the Config struct
  • Library API: Go developers can now import and use lines as a dependency in their projects

CI/CD & Release Automation

  • Enhanced GitHub Actions workflow with code quality checks
  • Added go fmt, go vet, and go mod tidy verification
  • Automated cross-platform binary builds for Linux, macOS, and Windows
  • Automatic release creation with compiled binaries

Documentation

  • Completely rewritten README with clear installation and usage instructions
  • Added library usage examples for Go developers
  • GitHub sponsorship configuration

Installation

go install github.com/Moderrek/lines/cmd/lines@v1.2.0

Usage Examples

Analyze current directory:

lines

Display top 5 file extensions by line count:

lines --dir ~/projects/my-app --top 5

Get results in JSON format for scripting:

lines --dir ~/projects/my-app --json

Use as a library in your Go project:

import "github.com/moderrek/lines/pkg/lines"
config := lines.Config{
 IncludeHidden: false,
 BufferInitialSize: 64 * 1024,
 BufferMaxSize: 1024 * 1024,
}
counter := lines.NewCounter(config)
result, err := counter.Run("./src")
Assets 8
Loading

1.0.1

13 Jun 04:56
@Moderrek Moderrek

Choose a tag to compare

Added Linux/Windows colored standard output

Colored output image

New flags

lines --no-color # Disables colored standard output
Loading

1.0.0

08 Jun 15:01
@Moderrek Moderrek
c671370
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

Blazingly fast command-line concurrent non-blank line counter implemented in GO using lightweight execution threads.

⚙️ Usage

lines # Prints file with the most lines at current directory
lines --dir # Path to the analysis folder
lines --top N # Prints the top N files
lines --hidden # Allow to analyze hidden files & dirs
lines --version # Prints installed version
lines --help # Prints help

📈 Example output

lines --dir C:\Users\Moderr\dev --top 5
Analyzing.. C:\Users\Moderr\dev
.java | Lines of code: 24409
.json | Lines of code: 8828
.yaml | Lines of code: 4980
.tsx | Lines of code: 4357
.yml | Lines of code: 1122
Time taken: 27.157ms to analyze 79 635 files
Loading

AltStyle によって変換されたページ (->オリジナル) /