npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

locio

v1.0.1

Published

A powerful CLI tool to count lines and files in directories with extensive filtering options

Downloads

593

Readme

LocIO

A powerful CLI tool to count lines and files in directories with extensive filtering options.

Features

  • Count files and lines recursively in directories
  • Interactive home page - friendly menu when run without arguments
  • Extensive filtering - patterns, extensions, directories, file names
  • Multiple extensions - comma-separated extension lists (e.g., rs,ts,js)
  • Size filtering - exclude files by minimum/maximum size
  • Binary detection - automatically exclude binary files
  • Comment analysis - count comment lines separately (full-line and inline)
  • Remove comments - automatically remove comments from code files
  • Project type detection - automatically detects project type (Node.js, Rust, Python, etc.)
  • Auto-excludes - automatically applies common excludes based on detected project type
  • Export reports - save results in multiple formats: txt, json, csv, tsv, markdown, html
  • Watch mode - automatically rescan on file changes
  • Top files/dirs - show largest files and directories with most files
  • Fast and efficient - built with TypeScript
  • Rich statistics - detailed breakdown by file extension and directory

Quick Start

Installation

Run with npx (no global install)

npx locio@latest

Install globally with npm

npm install -g locio

Your First Count

# Count files and lines in current directory (shows interactive menu)
locio

# Count in specific directory
locio /path/to/directory

# Count only TypeScript files (dot is optional: .ts or ts both work)
locio --include-ext ts,tsx --stats

Documentation

Full Documentation Available Here

The documentation includes:

  • Complete CLI reference
  • All filtering options and patterns
  • Advanced examples and use cases
  • Export format specifications (JSON, CSV, TSV)
  • Best practices and tips

Basic CLI Usage

# Count files and lines
locio

# Count only files
locio --files-only

# Count only lines
locio --lines-only

# Exclude patterns
locio --exclude ".*\.log$" --exclude-dir node_modules

# Include only specific extensions (comma-separated, dots optional)
locio --include-ext rs,ts,js --stats

# Export report in JSON format
locio --stats --export json

# Count comments separately
locio --comments --stats

# Remove comments from TypeScript files
locio --rm-comments ts

# Watch directory for changes
locio --watch

Quick Example

# Count TypeScript source files with statistics
locio --include-ext ts,tsx --stats

# Count TypeScript files excluding node_modules (multiple extensions supported)
locio --include-ext ts,tsx --exclude-dir node_modules

# Count with size limits and binary exclusion
locio --max-size 5MB --no-binary --stats

# Export JSON report (writes to LocIO-report.json)
locio --stats --export json

# Count comments and show code vs comments ratio
locio --code-vs-comments --stats

# Remove comments from JavaScript and TypeScript files
locio --rm-comments js,ts

# Show top 10 largest files
locio --stats --top-files 10

# Watch mode with statistics
locio --watch

"LocIO: Count your code, not your worries."