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

voncount

v0.0.2

Published

Time to count your lines

Downloads

5

Readme

VonCount

I vant to count your lines

Count VonCount

Usage

$ npm install -g voncount
$ voncount COMMAND
running command...
$ voncount (--version)
voncount/0.0.1 darwin-x64 node-v14.15.4
$ voncount --help [COMMAND]
USAGE
  $ voncount COMMAND
...

Commands

voncount help [COMMAND]

Display help for voncount.

USAGE
  $ voncount help [COMMAND] [-n]

ARGUMENTS
  COMMAND  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for voncount.

See code: @oclif/plugin-help

voncount run PATH

run a count of a codebase

USAGE
  $ voncount run [PATH] [-c <value>]

ARGUMENTS
  PATH  location of codebase

FLAGS
  -c, --config=<value>

DESCRIPTION
  run a count of a codebase

See code: dist/commands/run/index.ts

Config

Configuration for voncount is totally optional, and can either live in a count.json file in the root of your code directory be explicitly provided with the -c or --config flag.

What Goes in Config?

include

An array of glob patterns to include, defaults to ['*'].

Examples

Typescript would be:

{
  "include": ["**/*.ts", "**/*.tsx"]
}

Go would be:

{
  "include": ["**/*.go"]
}

exclude

An array of glob patterns to exclude, defaults to [].

Examples

For node you would probably want

{
  "exclude": ["node_modules"]
}

groups

A group is a specific criteria to search for in the code. It will then be presented back as number of lines that qualify for the group, and as a percentage what that group represents in the code. This is useful for comment, documentation blocks or specific class/function detection (detecting reuse). A block is defined in terms of a regex that matches the start of that block, and another regex that matches the end of that block (with lines counted between those blocks)

Examples

For something like comment/documentation blocks where the code looks like:

/**
 * A button.
 *
 * @param label: Text to show on the button
 *
 * @example
 *
 * <Button
 *   label="Hello World"
 * />
 *
 * @returns JSX.Element
 *
 * @alpha
 */

You would want to match everything between /** and */:

{
  "groups": [
    {
      "name": "documentation",
      "between": {
        "start": "^\\/\\*\\*",
        "end": "^ \\*/$"
      }
    }
  ]
}

Be careful to correctly escape your regexs