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 🙏

© 2025 – Pkg Stats / Ryan Hefner

quick-sh

v1.0.8

Published

A local script management tool for quick execution of JavaScript and Shell scripts with alias support

Downloads

11

Readme

Quick Sh

npm version License: MIT

A local script management tool for quick execution of JavaScript and Shell scripts with advanced alias support.

中文文档 | English

Features

  • 🚀 Quick Execution: Run local scripts with simple q script-name command
  • 📁 Multiple Formats: Support JavaScript (.js), Shell scripts (.sh), and directories
  • 🔗 Advanced Aliases: Configure custom aliases with relative paths, absolute paths, and system commands
  • 📝 Parameter Forwarding: Pass arguments transparently to your scripts
  • 🎯 Smart Priority: Alias config > Script files > System commands
  • Global Access: Install once, use anywhere
  • 🧪 Comprehensive Testing: 16 automated test cases ensure reliability

Installation

npm install -g quick-sh

After installation, you can use the q command globally.

Quick Start

1. Set Script Directory

# Set your script directory
q -path /path/to/your/scripts

# Check current status
q -list

2. Run Scripts

# Run a JavaScript file
q myscript

# Run a shell script
q deploy.sh

# Run with parameters
q backup --target /data --compress

# Execute directory (looks for index.js or index.sh)
q myproject

3. Configure Aliases

Create or edit config.json in your script directory:

{
  "aliases": {
    "deploy": {
      "bin": "./deploy/index.js"
    },
    "backup": {
      "bin": "/usr/local/bin/backup.sh"
    },
    "start": {
      "bin": "npm start"
    }
  }
}

Commands

| Command | Description | Example | |---------|-------------|---------| | q -path <dir> | Set script directory | q -path ~/scripts | | q -list | Show current status and available scripts | q -list | | q -help | Display help information | q -help | | q <script> | Execute script or alias | q deploy |

Alias Configuration

Supported Alias Types

  1. Relative Path: Relative to script directory

    {
      "aliases": {
        "deploy": {"bin": "./deploy/index.js"}
      }
    }
  2. Absolute Path: Full system path

    {
      "aliases": {
        "backup": {"bin": "/usr/local/bin/backup.sh"}
      }
    }
  3. System Command: Execute system commands

    {
      "aliases": {
        "list": {"bin": "ls -la"},
        "findnode": {"bin": "which node"}
      }
    }

Execution Priority

  1. Alias Configuration (highest priority)
  2. Script Files (medium priority)
  3. System Commands (lowest priority)

Parameter Forwarding

All parameters are transparently forwarded to target scripts:

# These parameters will be passed to the script
q deploy --env production --verbose
q backup /data/important --compress

In your script, access parameters normally:

  • JavaScript: process.argv
  • Shell: $1, $2, etc.

Examples

Directory Structure

~/scripts/
├── config.json
├── deploy.js
├── backup.sh
└── utils/
    └── index.js

config.json

{
  "aliases": {
    "deploy": {"bin": "./deploy.js"},
    "util": {"bin": "./utils"},
    "backup": {"bin": "./backup.sh"},
    "start": {"bin": "npm start"}
  }
}

Usage

# Execute via alias
q deploy --env prod

# Execute shell script
q backup.sh /data

# Execute directory (looks for utils/index.js)
q utils --help

# System command via alias
q start

Development

Testing

# Run all tests
npm test

# Manual testing with example scripts
npm run test:manual

Project Structure

quick-sh/
├── bin/           # CLI entry point
├── lib/           # Core modules
│   ├── config.js      # Configuration management
│   ├── executor.js    # Script execution
│   ├── help.js        # Help text
│   ├── script-manager.js  # Main logic
│   └── utils.js       # Utilities
├── test/          # Test suite
└── examples/      # Example scripts

Requirements

  • Node.js >= 14.0.0
  • npm or yarn

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

  • Young6118 - Initial work

Support

If you encounter any issues or have questions, please open an issue on GitHub.