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 🙏

© 2024 – Pkg Stats / Ryan Hefner

lines-of-code-checker

v1.2.0

Published

Command-line tool to check files that exceed the specified number of lines of code

Downloads

166

Readme

lines-of-code-checker

NPM Version Build Status

lines-of-code-checker is a NodeJS command-line tool for checking files in a specified directory that exceed a specified number of lines, and outputting the results to the console or a log file.

Read this in other languages: English | 简体中文

➜  commander.js git:(master) locc -l 500
Scanning... 9 files found
Scan completed

Exclude directories: .git,node_modules

Files with more than 500 lines:

File: /Users/lsnsh/github/commander.js/package-lock.json , Lines: 6490
File: /Users/lsnsh/github/commander.js/lib/command.js , Lines: 2510
File: /Users/lsnsh/github/commander.js/CHANGELOG.md , Lines: 1419
File: /Users/lsnsh/github/commander.js/Readme.md , Lines: 1158
File: /Users/lsnsh/github/commander.js/Readme_zh-CN.md , Lines: 1072
File: /Users/lsnsh/github/commander.js/typings/index.d.ts , Lines: 970
File: /Users/lsnsh/github/commander.js/typings/index.test-d.ts , Lines: 703
File: /Users/lsnsh/github/commander.js/lib/help.js , Lines: 521
File: /Users/lsnsh/github/commander.js/tests/command.positionalOptions.test.js , Lines: 521

Total files: 9
Check date: 2024-10-17T13:12:37.935Z

Features

  • Check the number of lines in files within a specified directory and its subdirectories
  • Support for setting a line threshold
  • Output results to the console or a log file

Installation

Install using npm:

npm install -g lines-of-code-checker

Usage

Command Line Options

locc [options]

Options

  • -d, --directory <paths> Specify the directories to check, separated by commas (default is the current directory)
  • -l, --lines <number> Set the line threshold (default is 200 lines)
  • -o, --output <path> Output the log to a specified directory (default is output to the console)
  • -e --exclude <paths> Specify the directories to exclude, separated by commas (default is .git and node_modules)

Examples

Check files in the current directory that exceed the default threshold of 200 lines and output the results to the console:

locc

Check files in the current directory that exceed 200 lines and output the results to the console:

locc -l 200

Check files in the path/to/directory directory that exceed 200 lines and output the results to the console:

locc -l 200 -d path/to/directory

Check files in the path/to/directory directory that exceed 200 lines and output the results to the path/to/output directory:

locc -l 200 -d path/to/directory -o path/to/output

Check files in multiple directories (path/to/directory1 and path/to/directory2) that exceed 200 lines and output the results to the path/to/output directory:

locc -l 200 -d path/to/directory1,path/to/directory2 -o path/to/output

Questions?

Please submit an issue. Before submitting, please search existing issues first.