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

grump

v0.0.2

Published

Find, use, and share useful actions for the command line

Downloads

5

Readme

##What is a Grump? A Grump is any task or set of tasks you want to be able to run with a single command from your terminal.


##What is Grump?

Grump is a command line utility for Mac that enables the saving and sharing of simple node and bash scripts (i.e. Grumps). Grump enables you to run your favorite scripts on any machine with an internet connection. Additionally with the ability to dynamically set variables at run time, sharing scripts between people is easy.

tl;dr the inspiration came from this chart (courtesy XKCD): XKCD Automation

IF YOU CAN'T SHARE This is a good chart- that accurately describes the reality of task automation

IF YOU CAN SHARE it is a bad chart. Every additional person that can use the automation increases the net time saved: ipso facto we enabled sharing the automation, maybe someday we will remake this chart in 3d.


##How do I use Grump to run Grumps? Grump is currently an NPM module. Get Grumpy by running $ npm install grump -g (requires npm to be installed)

Once you have Grump installed it's a simple as $ grump <grump_command> in the terminal.

If there are multiple Grumps by the same name you will be prompted to select which Grump you want to install on your machine. This will then be the default Grump run by that particular command -- to use other Grumps by the same name, type in <owner>/<grump_command> and Grump will run that one.

Grump will then prompt you for variables.

Have fun, get Grumpy!


##How do I find Grumps to use? GrumpJS.com has our full library of available grumps-- we are actively working to improve the explore Grumps feature.


##How do I turn my node and bash scripts into Grumps?

  1. Be sure to include a grump.json (see grump.json)
  2. Ensure that any user input you will want on initialization or at runtime follows our convention (see variables)
  3. Host your Grump on github in a public repo
  4. Go to our upload page at GrumpJS.com
  5. Upload your grump
  6. Test it out (if you need to delete it you can always login with github and remove it from our library)

##How do I write a grump?

  1. follow our grump conventions (note that Grump currently only support scripts written in node and bash-- but cannot install requirements for node files-- so anything required beyond Node’s core modules will not work.)
  2. upload your grump on grumpJS.com

##Grump Conventions:

#####1. All your code is hosted in a public github repo

####2. Your repo includes a grump.json in the root directory a. Reference our grump template (below)

b. The grump.json file must include the following fields:

  • i. defaultCommand (i.e. what the user types in, another key for each command (including defaultCommand)
  • ii. scriptType: “bash” or “node”.
  • iii. scriptPath: the path of the file you want us to run when the command is entered (path is relative to the root directory).

####3. Variables are named using the convention Grump_<var>* a.. Grump will prompt the user for every variable included in the grump.json and in your script that follows the convention Grump_<var>.

b. to include variables in grump.json include a “vars” object: for each variable create an object in the vars object with a persist property (either true or false) -- see below for explanation of variable types.

c. Variables can be of two types:

  • i. Persisting Variables: are set the first time the script is run, and never again. (e.g. connection strings to your.
  • ii. Non-Persisting variables: are set each time the script is run. (e.g. passwords you dont want to store)

##Grump.json template:

{
  "defaultCommand": "<defaultCommand>",
  "commands": {
    "<defaultCommand>": {
      "scriptType": "<node || bash>",
      "scriptPath": "<path of file to run when script is invoked>",
      "vars": {
        "<name of var1>": {
          "persist": true
        },
        "<name of var2>": {
          "persist": false
        }
      }
    }
  }
}

Written with StackEdit.