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

nyc-line-visit-count-reporter

v0.1.0

Published

Get visit counts of interest (e.g., top 10 most visited lines) with file and line number

Downloads

6

Readme

nyc-line-visit-count-reporter

Note: This project is somewhat unstable. It also requires use of an nyc fork in order to get options passed to it.

Installation

npm i -D nyc-line-visit-count-reporter

Usage

Note that for this reporter to work, you cannot set instrument to false.

For running tests, e.g., with Mocha:

nyc --reporter-options <option1=val1> --reporter-options <option2=val2> --reporter nyc-line-visit-count-reporter npm run mocha

For reporting on results after the fact:

nyc report --reporter-options <option1=val1> --reporter-options <option2=val2> --reporter nyc-line-visit-count-reporter

Reporter options

absolutePaths

Whether to show absolute paths instead of paths relative to the current working directory.

Defaults to false.

maxItems

How many items to display. Defaults to 10.

outputFile

A single relative file path (relative to the coverage directory) to which to write the output. Defaults to null (i.e., writes to console.

file

File, semi-colon-separated list of files, or array of files to be reported on.

Defaults to not being used.

noAggregate

Whether to avoid calculating maxItems relative to the results across files in aggregate rather than per file.

If true, will group the items by file, with each group listing the number of maxItems per file group.

If false, will only list one set (limited by maxItems), sorting exclusively by visit count (though listing file name for each entry).

The available file groups will be all covered files unless file is set.

Defaults to false.

To-dos

  1. Get tests working consistently with coverage
  2. See about avoiding need for fork --reporter-options; see nyc PR# 1312.

Possible to-dos

  1. Interactive mode where one can selectively open files (with line/column as IDEs such as Atom understand) by number.
  2. Could add es6-template-strings to allow user to control appearance
  3. Others data besides on statements:
    1. Top visited functions (or the function within which a statement occurs) along with the function name. line and column of loc.start and loc.end (or decl.start and decl.end?)
    2. Top visited branches, along with its type (e.g., switch) and whether it was for an if or else (the first or second item in the b array). line and column of loc.start and loc.end (shouldn't need locations which list locations of all branches, e.g., of a switch or if-else)