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 🙏

© 2025 – Pkg Stats / Ryan Hefner

meowtastic

v0.7.2

Published

A helper library for `meow`. Automatically create stylized help text and more.

Readme

meowtastic

A helper library for meow. Automatically create stylized help text and more.

Example of the meowtastic help text output.

Features

  • Automatically styles Markdown code spans.
  • Displays a usage example which can be customized.
  • Lists all available flags in alphabetical order. Displays descriptions as well if specified.
  • Is easily themeable.
  • Provides optional descriptions and short flags for the help and version flags.
  • Supports the NO_COLOR environment variable standard.
  • Wraps help text at 80 columns by default, although this can be disabled.
  • Provides variables which expand into the choices or default values of flags.

Install

npm install meowtastic

Usage

import meow from 'meow';
import { type Config, getHelpTextAndOptions } from 'meowtastic';

// Includes all the options that `meow` accepts.
// See https://github.com/sindresorhus/meow#api for reference.
const config: Config = {
  arguments: [
    { name: 'file', isRequired: true },
    { name: 'additional files...' }
  ],
  flags: {
    example: {
      default: 'this',
      description: 'An example... yeah! Defaults to %DEFAULT%.',
      shortFlag: 'e',
      type: 'string'
    },
    codeSpans: {
      description: 'Use `backticks` to format text.',
      shortFlag: 'c',
      type: 'boolean'
    },
    choices: {
      description: 'A list of choices. Options are %CHOICES_AND%.',
      shortFlag: 'C',
      type: 'string',
      choices: ['one', 'two', 'three']
    }
  },
  importMeta: import.meta,
  packageOverrides: {
    bin: { meowtastic: 'path/to/bin' }
  }
};

meow(...getHelpTextAndOptions(config));

Or if desired, a more granular approach:

import meow from 'meow';
import {
  type Config,
  type Flags,
  getHelpAndVersionFlags,
  getHelpText
} from 'meowtastic';

const flags: Flags = {
  ...getHelpAndVersionFlags(), // <- Add a description and short flag to `help` and `version`.
  example: {
    default: 'this',
    description: 'An example... yeah! Defaults to %DEFAULT%.',
    shortFlag: 'e',
    type: 'string'
  },
  codeSpans: {
    description: 'Use `backticks` to format text.',
    shortFlag: 'c',
    type: 'boolean'
  },
  choices: {
    description: 'A list of choices. Options are %CHOICES_AND%.',
    shortFlag: 'C',
    type: 'string',
    choices: ['one', 'two', 'three']
  }
};

const config: Config = {
  arguments: [
    { name: 'file', isRequired: true },
    { name: 'additional files...' }
  ],
  flags,
  importMeta: import.meta,
  packageOverrides: {
    bin: { meowtastic: 'path/to/bin' }
  }
};

meow(
  getHelpText(config),
  {
    description: false,
    flags,
    importMeta: import.meta
  }
);

Also, commands are supported:

import meow from 'meow';
import { type Config, getHelpTextAndOptions } from 'meowtastic';

// Includes all the options that `meow` accepts.
// See https://github.com/sindresorhus/meow#api for reference.
const config: Config = {
  commands: {
    initialize: {
      arguments: [{ name: 'file', isRequired: false }],
      description: 'Initialize a new project.'
    }
  },
  flags: {
    example: {
      default: 'this',
      description: 'An example... yeah! Defaults to %DEFAULT%.',
      shortFlag: 'e',
      type: 'string'
    },
    codeSpans: {
      description: 'Use `backticks` to format text.',
      shortFlag: 'c',
      type: 'boolean'
    },
    choices: {
      description: 'A list of choices. Options are %CHOICES_AND%.',
      shortFlag: 'C',
      type: 'string',
      choices: ['one', 'two', 'three']
    }
  },
  importMeta: import.meta,
  packageOverrides: {
    bin: { meowtastic: 'path/to/bin' }
  }
};

meow(...getHelpTextAndOptions(config));

See the "types" file (src/types.ts in the source distribution and dist/types/types.d.ts in the package distribution) for more information.

Theming

A theme has the following type signature:

// All these cases are exactly like they sound, except for "title". It's a faux titlecase format
// in which the first letter of each word is capitalized.
export type TextCase = 'lower' | 'title' | 'upper';

// All the `string` types below can accept a string in the form of anything accepted by
// [chalk-pipe](https://www.npmjs.com/package/chalk-pipe) for formatting. Of note, if you do
// not want to use any styling, you can pass an empty string.
export type Theme = {
  // Required arguments displayed in the usage section.
  argument?: string | [string, TextCase];

  // The application binary's name.
  bin?: string;

  // Markdown code spans in the app description or flag descriptions.
  code?: string;

  // Commands displayed in the commands section.
  command?: string | [string, TextCase];

  // Flags displayed in the options section.
  flag?: string;

  // Section headers such as "Usage" and "Options".
  header?: string | [string, TextCase];

  // Optional arguments displayed in the usage section.
  option?: string | [string, TextCase];

  // The shell prompt symbol ("$") used in the usage section.
  promptSymbol?: string;
};

You can modify the default theme:

import meow from 'meow';
import { getDefaultHelpTextTheme, getHelpTextAndOptions } from 'meowtastic';

const theme = getDefaultHelpTextTheme();

theme.header = ['blue.underline', 'upper'];

meow(...getHelpTextAndOptions({ importMeta: import.meta, theme }));

Or create a new theme from scratch:

import meow from 'meow';
import { type Theme, getHelpTextAndOptions } from 'meowtastic';

const theme: Theme = {
  bin: 'bold.green',
  code: 'bold.yellow',
  command: 'bold',
  flag: 'bold.blue',
  header: ['bold.underline.blue', 'upper'],
  option: 'bold.yellow',
  promptSymbol: 'bold.green'
};

meow(...getHelpTextAndOptions({ importMeta: import.meta, theme }));

Prior Art

License

The BSD 3-Clause License. See the license file for details.