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

pyr

v1.1.1

Published

A package for creating a script to store and run your most commonly used CLI commands

Downloads

22

Readme

📜 Pyr

pyr is a tool for storing and running project specific commands in the CLI and documenting those commands in an easy format that can be committed directly to a projects repo for developers to share common commands.

Scripts

pyr uses the concept of scripts stored as .yml files. Scripts are made up of options, command, message and directory tags that are used to construct the layout of the script e.g.

hello:
    message: "What language would you like to use?"
    directory: "~/Desktop"
    options:
        spanish:
            directory: "~/Desktop/Spain"
            message: "Hola mundo!"
            command: "echo Hola mundo >> spanish.txt"
        french:
            directory: "~/Desktop/French"
            message: "Bonjour le monde!"
            command: "echo Bonjour le monde! >> french.txt"
        english:
            message: "Australian or British?"
            options:
                australian:
                    directory: "~/Desktop/Australia"
                    message: "G'day world!"
                    command: "echo g'day world >> australian.txt"
                british:
                    directory: "~/Desktop/British"
                    message: "Hello world!"
                    command: "echo hello world >> british.txt"

Scripts are easy to build and follow simple rules:

  1. The first tag in a script serves as the scripts name
  2. options tags are used to store lists of more options or command's
  3. command tags are used to store a string containing a shell command
  4. message tags are used to store messages that are printed to stdout when an option or command is selected
  5. directory tags are used to set where a command should be ran. When a command is ran, pyr recursively searches for the most recent directory tag to cd into

Local PYR file

Add and commit a pyr.yml to your project so developers can run pyr or pyr -D to run shared commands.

Commands

λ pyr

    Usage: pyr [options]

    Options:
      -V, --version                                   output the version number
      -c, --config                                    display configuration
      -d, --delete [script name]                      delete a previously saved script
      -A, --delete-all                                delete all previously saved scripts
      -D, --documented                                prepends the command to the questions when running a script
      -l, --list                                      list previously saved scripts
      -m, --modify [script name]                      modify a previously saved script
      -p, --print [script name]                       print a saved script
      -r, --run [script name]                         run a previously saved script
      -s, --save <path to .yml file>                  process and save a script
      -S, --shell                                     set the which shell should run commands
      -u, --update <script name> <path to .yml file>  process and update a script
      -h, --help                                      output usage information

Copyright

MIT