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

my-clib

v1.0.7

Published

This is a node module created to help build/create cli tools much faster and easier.

Downloads

47

Readme

my-clib.js creating command line tools much faster and easier.

Why was this project created ?

The reason I created my-clib.js is because I wanted to create my own version of git ( aka source control management system ) but ended making the basic functionality of a command line tool instead of actually building the software.

Later I tried looking for node modules to help me build much faster and easier but they were built with configuration and third party dependencies and poorly written documentation. So I decide to build a light weight node module for this purpose and less configuration as possible.

How easy is it to use my-clib.js

code example:

/*
    Here is a code example on how to set up my-clib.js
    making my own very simple version of curl.
*/
const clib = require('my-clib');


var method = ( action, obj ) => {


    var axios = require('axios');


    // the action is to the method in the dispatch_action method
    switch ( action ) {

        case 'GET':

            var url = obj.payload[0],
            htttpObj;
            axios.get(url)
                .then((resp) => {
                    if (resp.status !== 200) return clib.catchError(`*error: status code is a '${ resp.status }'.`);

                    htttpObj = {
                        header: resp.headers['content-type'],
                        server: resp.headers.server,
                        date: resp.headers.date,
                        status: resp.status,
                        url: resp.config.url,
                        // data: resp.data,
                    };
                    console.log( htttpObj );

                })
                .catch((err) => {

                    clib.catchError(`*error: ${ err.message }'.`);
                    console.log({
                        headers: err.config.headers,
                        method: err.config.method,
                        url: err.config.url,
                        data: err.data
                    });
                })
            break;
    }
};

// parses the arguments in the command line
clib.argParser(process.argv, (err, obj) => {
    if (err) return clib.catchError(err); // logs to the console any errors that occurred

    /*
        [if] the are no errors then
        this callback returns back a
        objects of the parsed arguments

        obj = {
            action: '',
            args: [],
            payload: []
        }
    */

    /*
        calling the method dispatch action
        resemblance to redux approach

        passing in the method and the parsed
        command line arguments
    */
    clib.dispatch_action(method, obj);
});
node app.js GET https://www.github.com/andreGarvin/my-clib

{ header: 'text/html; charset=utf-8',
  server: 'GitHub.com',
  date: 'Thu, 01 Jun 2017 14:24:05 GMT',
  status: 200,
  url: 'https://www.github.com/andreGarvin/my-clib' }

How does my-clib.js work and what are its methods ?

The code example above is a very simple way to set up the node module, this a module that comes with much more and great tools to make your cli application very efficient.

Documentation

Link to module

documentation

These methods are very easy use and tinker around when creating your own cli tool or configure to your already existing application, so feel free to edit the code and so forth. Also contribute any new ideas or methods to make the module amazing, make a issue or pull request on tis project.

You can also contact me on twitter for any new ideas or implementations.