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

ducktails

v0.1.1

Published

🦆 ducking beautiful log tails

Downloads

3

Readme

ducktails is a tail -f-like live log CLI tool for one or multiple files, directories or globs with colorful formatting options.

☑ live log of multiple files, directories or globs

☑ automatically pick up new files created while running

☑ customize colors and other styling options

🦆 Usage

npx ducktails [options] <files...>

$ npx ducktails --help

Usage: tails [options] <files...>

Arguments:
  files                file paths or globs

Options:
  -V, --version        output the version number
  -c, --config <file>  path to config
  -h, --help           display help for command

🎨 Formatting

ducktails uses chalk for formatting, configured via a json config file.

Here's an example with explanations and its output:

{
  // Use the schema property for autocompletion in editors
  // like VS Code - ducking awesome!
  "$schema": "https://github.com/st4ng/ducktails/releases/download/v0.1.0/ducktails.schema.json",

  /**
   * A mapping of strings/regexes to styles. The string will be replaced within
   * each log line by its styled version. For regexes with capture groups, the
   * style will be applied to all matching capture groups of the regex.
   *
   * The styles are an array of chalk colors or modifiers, e.g.
   * `["red", "bold"]`. You can also use functions like rgb by passing a nested
   * array, where the first element is the function name and the rest is the
   * parameters, e.g. `[["rgb", 255, 255, 255], "bold"]`.
   *
   * @see {@link https://github.com/chalk/chalk} for more information
   * about colors and modifiers. Note: your terminal might not support all
   * of them.
   */
  "styles": {
    // If you use a string, you can directly assign the style
    "ducks": ["underline"],
    // If you want to use a regex, you must use an object and
    // set regex true.
    "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}": {
      "regex": true,
      "style": ["blue"]
    },
    "\\[(warn)\\] (.*)": {
      "regex": true,
      "style": ["yellow"]
    },
    "\\[(error).*?\\](.*)|(^ *at .*)": {
      "regex": true,
      "style": ["red"]
    }
  },
  /**
   * Tag that will be prepended to each logged line. The "{file}" placeholder
   * will be replaced with the filename the log line belongs to.
   *
   * If you don't want to apply a style you can also directly assign your
   * template instead of an object.
   *
   * Default template: "[{file}] "
   */
  "tag": {
    "template": "{file}| ",
    "style": ["grey"]
  }
}
Output