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

@rocketmakers/shell

v0.2.0

Published

The suite of `@rocketmakers/shell-*` packages provides support for running common commands in a shell, using TypeScript.

Downloads

1,057

Readme

The suite of @rocketmakers/shell-* packages provides support for running common commands in a shell, using TypeScript.

Overview

@rocketmakers/shell

All scripts will need to use @rocketmakers/shell package, which provides the core features:

  • Parsing command line arguments
  • Prerequisite checking for required commands in the environment
  • Logging utilities
  • An abstraction for running a command in a shell, with options for how the output is handled
    • The executor can be used from the @rocketmakers/shell-executor package, or a custom implementation could be implemented if needed

@rocketmakers/shell-executor

This contains a default implementation of the IShellExecutor interface.

@rocketmakers/shell-* packages

The majority of @rocketmakers/shell-* packages contain commands relating to a shell executable. For example, @rocketmakers/shell-sops contains commands for working with sops.

Quick start

This shows a typical script using @rocketmakers/shell:

  1. Create an IShellExecutor
  2. Parse arguments
  3. Set a default log level
  4. Perform a prerequisites check
  5. Execute commands
import { LoggerLevel } from '@rocketmakers/log';
import * as Args from '@rocketmakers/shell/args';
import { createLogger, setDefaultLoggerLevel } from '@rocketmakers/shell/logger';
import * as Prerequisites from '@rocketmakers/shell/prerequisites';
import { ShellExecutor } from '@rocketmakers/shell-executor';

// Any loggers created via createLogger will respect the level set by seDefaultLoggerLevel
const logger = createLogger('hello-world');

// We need an instance of IShellExecutor to run commands
const shell = new ShellExecutor();

async function run() {
  const args = await Args.match({
    // Example of matching an optional log level argument, defaulting to an environment variable
    log: Args.single({
      description: 'The log level',
      shortName: 'l',
      defaultValue: process.env.LOG_LEVEL || 'info',
      validValues: ['trace', 'debug', 'info', 'warn', 'error', 'fatal'],
    }),
  });

  if (args?.log) {
    setDefaultLoggerLevel(args.log as LoggerLevel);
  }

  // Args.match prints the docs for each arg if args couldn't be parsed so this is a useful pattern for supporting --help
  if (!args) {
    if (process.argv.includes('--help')) {
      return;
    }

    throw new Error('There was a problem parsing the arguments');
  }

  // This will throw if the environment does not contain the expected commands
  await Prerequisites.check(shell);

  await shell.exec(['echo', '"Hello World!"']);
}

run()
  .then(() => logger.info('🚀 Done 🚀'))
  .catch(err => {
    logger.fatal(err);
    process.exit(-1);
  });