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

@qui-cli/core

v5.0.0

Published

Core features of @qui-cli/qui-cli

Readme

@qui-cli/core

Core features of @qui-cli/qui-cli

npm version Module type: ESM

Install

npm install @qui-cli/core

Usage

import { Core } from '@qui-cli/core';
import { Colors } from '@qui-cli/colors';
import { Log } from '@qui-cli/log';

// register custom arguments
await Core.init({
  opt: {
    foo: {
      description: 'bar'
    }
  }
});

// process user-provided command-line arguments
const { values, positionals } = await Core.run();

// use Log and Colors
Log.debug(values.foo);
Log.debug(positionals.length);
Log.info(
  `This is a ${Colors.value('value')} and a ${Colors.quotedValue('"quoted value"')}.`
);

See examples for common use cases.

Core Plugins

Three core plugins are registered automatically to provide consistent functionality.

jackspeak

Manages any custom jackspeak options. As with any other plugin, it can be configured via Core.configure():

await Core.configure({
  jackspeak: {
    envPrefix: 'MY_APP'
  }
});

positionals

Provides per-plugin positonal argument management and documentation. Individual plugins can require named positional arguments, which are collected and documented by usage() and accessible throgh the Positionals plugin.

import { Core, Positionals } from '@qui-cli/core';

Positionals.require({
  my_number: {
    description: 'How far left to move',
    validate: (v?: string) => !isNaN(v) || 'my_number must be a numeric value'
  }
});

await Core.run();

console.log(Positionals.get('my_number'));

Positional arguments are processed in the order in which plugins are registered. Thus, if plugin A requires positional arguments a1 and a2, plugn B requires positional arguments b1 and b2 and depends on plugin C which requires positional argument c1, the resulting positional argument order would be: a1 a2 c1 b1 b2.

Unnamed arguments can also be required, however this is a dicey proposition to implement within a plugin and is likely best reserved for independent apps that consume plugins, as the min and max number of positional arguments check against the currently registered list of required named positonal arguments for validity (as well as their own respective values). In general, configuring unnamed positional arguments is best done before any required named positional arguments are defined.

// require at least 2 and no more than 5 unnamed positionals:
//   arg0 arg1 [arg2 arg3 arg4]
Positionals.configure({ min: 2, max: 5 });

//.  nemo arg0 arg1 [arg2 arg3 arg4]
Positionals.require({ nemo: { description: 'I have a name!' } });

// fails: nemo is required, must be at least 1
Positionals.setMinArg(0);

// succeeds
Positionals.setMinArg(6);

// fails: is less than current min
Positionals.setMaxArg(4);

help

Provides consistent --help (-h) flag for all commands that displays usage. No confiuration.

Configuration: configure(config?: Configuration): void

Programmatic configuration to set defaults before generating user-facing usage documentation or processing user-provided command line arguments.

Invoking Core.configure() triggers the configure() hook for all registered plugins.

Refer to @qui-cli/plugin for further details on plugin configuration.

Options: options(): Options

Generate command-line options for jackspeak initialization and user-facing usage documentation.

Invoking Core.options() merges the options() hooks of all registered plugins.

Refer to @qui-cli/plugin for further details on plugin options.

The --help (-h) flag is appended to output user-readable usage information to the command-line.

Initialization: init(options?: Options): Arguments

Initialize the app with user-provided command-line arguments, processed based on the result of options(), returning the processed user-provided command-line arguments from jackspeak.

Invoking Core.init() also initializes the init() hook for all registered plugins.

Refer to @qui-cli/plugin for further details on plugin initialization.

Additional app-specific command-line options can be provided with an Options object as described in @qui-cli/plugin.