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 🙏

© 2026 – Pkg Stats / Ryan Hefner

forge-cli

v0.2.1

Published

A simple cli framework to provide an easy interface to register commands for cli apps

Readme

What is forge-cli?

It's the beginning of a simple cli framework heavily inspired by Laravel Artisan. Specifically the way they handle anonymous cli commands and registering new commands. I'm not saying the code base is based upon it. Just the way you interact with everything.

So how do I use it?

yarn add forge-cli

or

node add --save forge-cli

then somewhere in you script

var Application = require('forge-cli');
// and register a command like so.
Application.register(__dirname, [
    './relative/path/from/__dirname/to/file'
])
// and individual commands like so
Application.command('command {argument} --option', function() {
    // your code here!
})

docs

Registering new commands

Eventually this will be done more simply; however, at this moment I have only added support though.

If we wanted to register the usage of the following command node index.js your:command MyArgument --yourOption=no

the code we would need to make it work is below.

Application.command('your:command {yourArgument} {--yourOption}', function() {
    // Your code to execute when the command is called.
    // this.option('yourOption') will either return the 
    // value it's set equal to (in the example it would be the word "no",
    // true if it exists, or false if it doesn't exist.
    
    // this.argument('yourArgument') will return the text that's passed
    // in it's place (in the example it would be the word "MyArgument") or null
});

Real life example.

If you have a webhook that you want to post to you might do something like:

'use strict';
let Application = require('forge-cli');
    // I'm using axios to make an http request, you can use anything in this closure,
    // I just like axios for http requests...
let axios = require('axios');

// Register your command
Application.command('http:post {url} {--https}', function() {
    let isSecure = this.option('https'),
        urlToPostTo = this.argument('url');
    // Use axios to post to the url
    axios.post((isSecure? 'https://' : 'http://') + urlToPostTo, {})
        .then(response => {
            console.log(response.status)
        })
});

let args = Object.assign({}, {args: process.argv});

// This "starts" the application
Application.start(args);

Then to use this command you can just type (in your console)

node index.js http:post example.com or node index.js http:post example.com --https And the url's they'll hit are http://example.com and https://example.com respectively.

Helpers?

You have full access to the inquirer library via this.inquirer in your command's closure.