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

tailchart

v1.0.2

Published

A smarter way to follow files and logs

Downloads

14

Readme

tailchart

A smarter way to follow files and logs.

screen

Install

npm install -g tailchart

Usage

tailchart

Make the assumption that you have a config.json file in the current directory.

You can specific the path of the configuration file by using the tailchart --config mypath/conf.json

Once running, press "r" to reset the value in the different widgets.

Configuration

At this point in time, tailchart require a configuration file to starts.

When running, tailchart display info of the full surface of the terminal window. You position and size the different widgets by using a grid system.

Below is an example of a valid configuration (comments are automatically stripped out):

{
  // Required, only one value for now
  "version": "1.0",

  // Required. Path to the fail we will tail
  "source": "/var/log/system.log",

  // Required. Must be an array of objects
  "widgets": [
    // Raw Log Widget
    // Display all log lines
    {
      "type": "raw",      // required
      "name": "Raw Logs", // Required, must unique accross all widgets
      "col": 0,     // required, integer
      "colspan": 1, // required, integer
      "row": 0,     // required, integer
      "rowspan": 1, // required, integer
      
      "prefixTrimIndex": 0, // optional, integer. Remove the N first character of the line
      "highlights": {
        "lines": [ // optional, array. Each line match will be printed in the specified color
          {
            "color": "red",   // required, string
            "match": "error" // required, string that compile to a valid regular expression
          }
        ]        
      }
    },
    
    // Filter Log Widget
    // Display only the log lines that match a regular expression. 
    // + all functionnality of raw
    {
      "type": "filter",   // required
      "name": "Raw Logs", // Required, must unique accross all widgets
      "col": 0,     // required, integer
      "colspan": 1, // required, integer
      "row": 0,     // required, integer
      "rowspan": 1, // required, integer
      
      // Specific options
      "match": "error|warning", // required, string compiling to regular expression. Define what is capture by widget
      
      // Options inherited from RawLog
      "prefixTrimIndex": 0, // optional, integer. Remove the N first character of the line
      "highlights": {
        "lines": [ // optional, array. Each line match will be printed in the specified color
          {
            "color": "red",   // required, string
            "match": "error"  // required, string that compile to a valid regular expression
          }
        ]        
      }
    },

    // Split Counter Widget
    {
      "type": "splitCounter",         // required 
      "name": "Sonos App Error type", // Required, must unique accross all widgets
      "col": 3,     // required, integer
      "colspan": 1, // required, integer
      "row": 0,     // required, integer
      "rowspan": 1, // required, integer
      
      // Specific options
      "match": "<Error> ([a-z]+)" // require, string compiling to regular expression.
                                  // must have 1 capturing group
    }
  ]
}

Widgets

RawLog

Display all the logs line. Optionally:

  • trim the N first character of the line (perfect to remove useless prefix)
  • display in a specific color lines matching a regular expression
{
  "type": "raw", // required
  "name": "Raw Logs", // Required, must unique accross all widgets
  "col": 0, // required, integer
  "colspan": 3, // required, integer
  "row": 0, // required, integer
  "rowspan": 3, // required, integer
  "prefixTrimIndex": 0, // optional, integer. Remove the N first character of the line
  "highlights": {
    // optional, objecct
    "lines": [
      {
        "color": "red",
        "match": "error"
      },
      {
        "color": "yellow",
        "match": "warning"
      }
    ]
  }
}

FilterLog

Same functionality as RawLog with the twist that it display only the lines that are matching a regular expression.

{
  "type": "filter",
  "name": "Errors and Warnings",
  "col": 0, // required, integer
  "colspan": 3, // required, integer
  "row": 3, // required, integer
  "rowspan": 1, // required, integer

  "match": "error|warning",

  "prefixTrimIndex": 0, // optional, integer. Remove the N first character of the line
  "highlights": {
    // optional, objecct
    "lines": [
      {
        "color": "red",
        "match": "error"
      },
      {
        "color": "yellow",
        "match": "warning"
      }
    ]
  }
}

Counter

Count how many times something happen, and its frequency compare to other match. Perfect to visualize the distribution of error, type of queries, status code, etc counter

{
      "type": "counter",
      "name": "Sonos App Error type",
      "match": "<Error> ([a-z]+)",
      "col": 3,
      "colspan": 1,
      "row": 0,
      "rowspan": 2
    }

Dreamlist

  • [ ] Read from stdin to allow piping
  • [ ] Zero config start
  • [ ] In program UI to add/modify/remove widgets
  • [ ] Config import (like blue print in Factorio)
  • [ ] Save / Load config
  • [ ] Replay logs