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

strategos

v2.3.2

Published

A TypeScript focused solution for command-line applications.

Downloads

24

Readme

Strategos

A TypeScript focused solution for command-line applications.

Strategos is a new way to build command-line applications. Build with some class, and skip the method chaining.

⚠ Under Development ⚠

Strategos, although functional, is still a long ways from "general usage" in that it's lacking many useful features. This project is a learning experience for myself and not meant to be widely (or generally) used. Below are some wanted features.

  • Options
    • Currently I'm still debating how to handle options in the best way possible.
  • Dynamic usage information
  • Subcommands

Once these few items are taken care of, Strategos, like every good commander, will be battle tested and then enlisted! 🛡⚔

Install

yarn add strategos

Usage

Creating a command is extremely simple. Here's a simple echo command:

class CommandEcho extends CommandBase {
  constructor() {
    super({
      name: 'echo',
      alias: 'e',
      description: 'Returns input',
      version: '1.0.0'
    })
  }

  getUsage() {
    return 'echo <your_string>'
  }

  execute(args: string[]) {
    console.log(args[0])
  }
}

You can then get started by creating a Strategos instance and passing in any string array for testing, and process.argv.slice(2) for getting real command line input. Then pass in an array of your commands. I'm working on instantiatiing commands via a directory and naming scheme as well.

import { Strategos } from "strategos";

new Strategos(process.argv.slice(2), [new CommandEcho()]);

It's as simple as that.