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

universal-bash

v1.0.1

Published

install bash as dependency of your package

Readme

universal-bash

universal-bash is an npm package that enables the execution of Bash scripts on Windows systems, making it as easy as running them on macOS or Linux. It provides a seamless experience for developers who need to work with Bash scripts across different operating systems.

Please note that currently, universal-bash only supports Windows. However, future updates may include support for other platforms.

Installation

To use universal-bash, simply install it as a dependency in your project by running the following command:

npm install universal-bash

By default, universal-bash utilizes Git Bash, a popular Bash-compatible shell for Windows, as the underlying interpreter. If the system already has bash, universal-bash will use it for script execution.

If bash is not available, universal-bash will automatically install git-bash as a local dependency to ensure compatibility. However, this behavior can be disabled by setting the NOT_USE_GLOBAL_BASH environment variable to 1 during the package installation process.

For example, you can run the following command to install universal-bash and force the installation of a local copy of Git Bash:

NOT_USE_GLOBAL_BASH=1 npm install universal-bash

Usage

Using universal-bash is straightforward. Once installed, you can execute Bash scripts on your Windows machine using the bash command. The bash command is provided by Git Bash, which is utilized by universal-bash.

To run a Bash script, open your command prompt or terminal and use the following command:

bash path/to/your/script.sh

Replace path/to/your/script.sh with the actual path to your Bash script file.

If you have installed universal-bash globally, you can simply run bash followed by the path to your script from anywhere on your system.

Example

Here's a simple example to demonstrate how to use universal-bash:

  1. Create a Bash script file named hello-world.sh with the following content:
#!/bin/bash

echo "Hello, world!"
  1. Save the file in your project directory.

  2. Open your command prompt or terminal and navigate to your project directory.

  3. Run the following command to execute the script using universal-bash:

bash hello-world.sh

You should see the following output:

Hello, world!

Contribution

Contributions to universal-bash are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.

Please ensure that any contributions adhere to the project's coding standards and follow the guidelines outlined in the repository.

License

This project is licensed under the MIT License. For more information, please refer to the LICENSE file.


Thank you for choosing universal-bash! We hope it simplifies your experience with running Bash scripts on Windows. If you find it useful, please consider giving it a star on GitHub. If you have any questions, feel free to reach out to us.