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

runfile.sh

v0.0.2

Published

Language-agnostic project task runner built on the ubiquitous Make.

Downloads

8

Readme

runfile.sh

      · Language-agnostic project task runner · Missing companion of the ubiquitous Make ·
      · Use a Runfile on its own to manage project tasks · start, build, test, lint, etc ·
      · Use Runfile & Makefile in tandem to keep project tasks and build steps organized ·

tests shellcheck latest release npm package license

Contents - Usage | Install | Tests | License

If you'd like to jump straight in, try one of these or go to the Install section for more (curl, install man page, etc.):

brew tap evnp/runfile.sh && brew install runfile.sh
npm install -g runfile.sh

Usage

$ run --runfile-help

· Usage · run ····················· Print all available tasks.
          run [options] [task] ···· Run a task.
          run [options] [action] ·· Run a Runfile/Makefile action.
                                  · Task is ignored if action is specified.
  # ./Runfile syntax:
  taskabc: # task description
    shell command(s) for task abc
  taskxyz: taskabc # task description · taskxyz runs taskabc first just like Make would
    shell command(s) for task xyz

  ^ Whitespace doesn't matter; tabs, spaces, blank lines are all ok, or may be omitted.

· Actions ·

--runfile-help --runfile-usage ·· Print this usage documentation then exit.
--runfile-version ··············· Print current runfile.sh version then exit.

--runfile ··· Print contents of nearest Runfile (in current dir or dir above).
--makefile ·· Print contents of Makefile which will be generated from nearest Runfile.

--runfile-edit ··· Open nearest Runfile with $EDITOR (in current dir or dir above).
--makefile-edit ·· Open nearest Makefile with $EDITOR (in current dir or dir above).

--runfile-create  --runfile-write ··· Write template Runfile in current dir.
--makefile-create --makefile-write ·· Write generated Makefile in current dir.

--runfile-overwrite ··· Overwrite existing Runfile with template Runfile.
--makefile-overwrite ·· Overwrite existing Makefile with generated Makefile.

· Options ·

--runfile-compact ···· Use "compact" formatting for Runfile when creating or printing.
--runfile-confirm ···· Always ask for confirmation before opening files with $EDITOR.
--runfile-noconfirm ·· Never ask for confirmation before opening files with $EDITOR.
--runfile-noedit ····· Never open files with $EDITOR.
--runfile-verbose ···· Print code line-by-line to terminal during task execution.

--make-dry-run ·· Don't execute task code, just print line-by-line to terminal instead.
--make-* ········ Pass any argument directly to they underlying Make command
                · by prefixing the intended Make argument with "--make-".
                · For example, --make-dry-run will pass --dry-run to Make.

Install

Homebrew:

brew tap evnp/runfile.sh && brew install runfile.sh

NPM:

npm install -g runfile.sh

Curl:

read -rp $'\n'"Current directories in \$PATH:"$'\n'"$(echo $PATH|sed 's/:/\n/g'|sort)"$'\n\n'"Enter a directory from the list above: " && [[ -z "${REPLY}" ]] && echo "Cancelled (no directory entered)" || ( curl -L -o "${REPLY/\~/$HOME}/runfile.sh" https://github.com/evnp/runfile.sh/raw/main/runfile.sh && chmod +x "${REPLY/\~/$HOME}/runfile.sh" )

runfile.sh has no external dependencies, but it's good practice to audit code before downrunfile.sh onto your system to ensure it contains nothing unexpected. Please view the full source code for runfile.sh here: https://github.com/evnp/runfile.sh/blob/master/runfile.sh

If you also want to install runfile.sh's man page:

read -rp $'\n'"Current directories in \$(manpath):"$'\n'"$(manpath|sed 's/:/\n/g'|sort)"$'\n\n'"Enter a directory from the list above: " && [[ -z "${REPLY}" ]] && echo "Cancelled (no directory entered)" || curl -L -o "${REPLY/\~/$HOME}/man1/runfile.sh.1" https://github.com/evnp/runfile.sh/raw/main/man/runfile.sh.1

Verify installation:

runfile.sh -v
==> runfile.sh 2.0.2

brew test runfile.sh
==> Testing runfile.sh
==> /opt/homebrew/Cellar/runfile.sh/2.0.2/bin/runfile.sh test --print 1234 hello world

Tests

Run once:

npm install
npm test

Use fswatch to re-run tests on file changes:

brew install fswatch
npm install
npm run testw

Non-OSX: replace brew install fswatch with package manager of choice (see fswatch docs)