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

asloc

v0.0.9

Published

Simple CLI tool for counting Single Lines of Code (SLOC)

Downloads

8

Readme

asloc

Note: This project, while usable, is currently a Work-In-Progress!

asloc is a very simple CLI tool for counting Single Lines Of Code (SLOC). The aim of the tool is to be as easy to use as possible, with the features you most want.

Features

asloc currently has the following features:

  • Filter by file extension type
  • Display per-file SLOC count and/or total count
  • Also displays the amount of comment lines
  • Supports recursive walking, so files in subdirectories can be listed as well
  • Count the SLOC and comment lines in all files in the given directory
  • Ignores empty lines by default

Missing

The following features will be added in a future version:

  • Provide a prettier output
  • Future talk: optionally parse .gitignore files to exclude files/dirs listed

Install

npm install -g asloc

Usage

$ asloc

Options

  • -d, --dir: directory to walk (defaults to the current directory)
  • -i, --ignorecomments: ignore comments when calculating SLOC count
  • -r, --recursive: do a recursive directory walk and list files in subdirs as well
  • -f, --filter: comma-delimited list of file types to count (e.g. js,css)
  • -v, --verbose: enable verbose, per-file SLOC count display
  • -h, --help: display help

Example usage

$ asloc -v
SLOC count per file:

 Files: myfirstfile.js
  SLOC: 23
  Comment lines: 6

 File: mysecondfile.js
  SLOC: 68
  Comment lines: 0

 File: mythirdfile.css
  SLOC: 18
  Comment lines: 1

Total SLOC count: 109
Total comment line count: 7

Changelog

  • 0.0.5 0.0.9 - 13 Oct 2015
    • Switched to process.cwd() instead of __dirname
    • Fixed a few typos - oops (today is not my day)
    • Added asloc.js to the bin field in package.json (should now be executable)
  • V0.0.1 - v0.0.4 - 12 Oct. 2015
    • Display amount of comment lines
    • Significant code cleanup
    • Added verbose option
    • Added filter option
    • Now supports recursive directory walking
    • Initial publish

License

Copyright 2015 Michiel van der Velde.

This software is licensed under the MIT License.