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

npm-script-selector

v1.4.0

Published

The NPM Script Selector is a CLI tool for discovering and running project scripts within package.json files.

Downloads

84

Readme

License npm npm Donate to this project using Buy Me A Coffee wakatime

░█▀█░█▀█░█▄█░░░░░█▀▀░█▀▀░█▀▄░▀█▀░█▀█░▀█▀░░░░░█▀▀░█▀▀░█░░░█▀▀░█▀▀░▀█▀░█▀█░█▀▄
░█░█░█▀▀░█░█░▄▄▄░▀▀█░█░░░█▀▄░░█░░█▀▀░░█░░▄▄▄░▀▀█░█▀▀░█░░░█▀▀░█░░░░█░░█░█░█▀▄
░▀░▀░▀░░░▀░▀░░░░░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░░░░▀░░░░░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░░▀░░▀▀▀░▀░▀

By: Justin Sunday GitHub: sundayj/npm-script-selector Website: JLSunday.com NPM: npm-script-selector


NPM Script Selector

The NPM Script Selector is a CLI tool for discovering and running project scripts within package.json files. Have you ever worked on a project that contains so many scripts that you can't always remember the available options? That's what happened to me. I currently contribute to a project with 30+ scripts. I became tired of having to open the package file and/or IDE in order to find and run the needed scripts, so I created this small CLI.

Currently, you provide the path to the package.json file, the NPM Script Selector will then list the available scripts for you, where you can interactively select the one you want. It will then run the script for you within the selected project's directory. I plan to add more functionality in the near future.

Uses figlet, commander, and inquirer.


Sponsoring

If you like this package, please consider sponsoring:


Feature Requests or Bugs

For feature requests, or bugs, please create an issue here


Features

  • Can be used as entry to other scripts.
  • Accepts path to a package.json as an input.
  • Lists scripts contained within that package.json.
  • Allows interactive selection of script.
  • Prints output from selected script.
  • Asks if you would like to run another script when the current one is finished.
  • App's title banner is customizable. Customize the font printed to the console when the CLI runs:
    • Change the words.
    • Change the font style. Font choices can be found here.

Future Features

  • [ ] Allow subcommands/options to be passed to selected scripts.
  • [ ] Option to search for package.json files within a directory.
  • [ ] Option to store the paths of frequently used files.
  • [ ] Option to run the selected scripts in a new window.
  • [ ] React GUI

Installation and Usage

Install NPM Script Selector with npm:

  npm i -g npm-script-selector

To run:

> npmss -f path/to/desired/package.json

For Help:

> npmss -h

Usage: npmss [options]

The NPM Script Selector is a CLI tool for discovering and running project scripts within package.json files.

Options:
  -V, --version               output the version number
  -f, --file <value>          Path to the package.json.
  -b, --banner <value>        Value for the title to be displayed to the user. (Replaces the NPM-Script-Selector banner.)
  -hb, --hide-banner          Use this flag if you'd like to not display a banner at all.
  -bf, --banner-font <value>  Pass the name of a font listed here to print the banner in the desired font. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/53d91777b0daa1b5b6b0beac63ab0b25126b7b13/types/figlet/index.d.ts#L2
  -h, --help                  display help for command

Path can be relative to current directory, or absolute.

NPM Script Selector Screenshot 20231025


Contributing

Bug reports and pull requests are welcome on GitHub at sundayj/npm-script-selector. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.


License

The package is available as open source under the terms of the MIT License.