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

xbash

v1.6.0

Published

Friendly, portable wrapper around bash.

Downloads

33

Readme

xbash

NPM package NPM downloads License: MIT

Friendly, portable wrapper around bash.

The wrapper is used to run shell-scripts in various node-powered applications. The wrapper makes sure that also curl and unzip are available inside bash, as needed by some cross-platform installers.

  • On Windows, the wrapper finds your Git for Windows installation and will prefer to run commands from there.

  • If a Git for Windows installation isn't found, and the commands aren't otherwise found, the wrapper will provide instructions on how to install Git for Windows.

Install

npm install xbash

This will install bash (alias xbash), a cross-platform wrapper around the real bash executable.

Usage

This package gives you a reasonably portable way to use bash and other tools – in JavaScript or from command-line.

JavaScript

const bash = require('xbash');

bash(['-c', 'echo Hello World!'], process.exit);

Command-Line

$ bash --version

ERROR: 'bash' was not found. This can be solved by installing Git.

Please get Git from https://git-scm.com/downloads and try again.

This happens when bash was not found. Running again after installing Git for Windows.

$ bash --version

GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

We can run scripts or invoke other commands (that aren't otherwise available in PATH).

$ bash script.bash

Hello World!
$ bash -c 'curl --version'

curl 7.65.1 (x86_64-w64-mingw32) libcurl/7.65.1 OpenSSL/1.1.1c (Schannel) zlib/1.2.11 libidn2/2.2.0 nghttp2/1.38.0
Release-Date: 2019-06-05
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP
$ bash -c 'unzip'

UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.

[...]

Contributing

Please report an issue if you encounter a problem, or open a pull request if you make a patch.