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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bash-base

v2.3.12

Published

A common lib for creating bash script easily.

Readme

This project has been moved to renault digital.

Welcome to bash-base

License GitHub top language codecov GitHub Actions Status Conventional Commits semantic-release GitHub release npm package Docker Cloud Build Status GitHub commits since latest release

What's bash-base?

A common lib for creating bash script easily like other program language.

  • Rich functions to operate array/list/set/string/arguments/reflect/..., the functions can be used in console or script
  • Just call bash-base function by name in your script, like other programing language, no need anymore to search "how to ... in bash"
  • Parse and validation arguments easily & flexible, automatically generate help usage for your script, focus your script only on the business logical
  • Make your script more compact & readability
  • Available on github/npm/dockerhub

Latest Update

See CHANGELOG.md

How to use

Get from github

Import bash-base directly from github during every execution

Simply write in console or script:

If to import latest version:

source <(curl -fsSL https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/src/bash-base.sh)
or
eval "$(curl -fsSL https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/src/bash-base.sh)"

If to import specific version:

source <(curl -fsSL https://raw.githubusercontent.com/zhang-hongjie/bash-base/v2.3.1/src/bash-base.sh)
or
eval "$(curl -fsSL https://raw.githubusercontent.com/zhang-hongjie/bash-base/v2.3.1/src/bash-base.sh)

Verify the import in console:

string_trim ' hello '
Notes

this way, your script need to access github when each time it launched.

Import bash-base using install.sh

The directory installed is ~/.bash-base.

source or install the specific version in console or shell script:
  • the man page of version v2.3.3: man bash-base.${version},
  • you can import this version in one line in your script:
source bash-base.v2.3.3 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/scripts/install.sh | bash -s -- v2.3.3"
but if you want always the latest version, source or install the latest version in console or shell script:
  • the man page is: man bash-base,
  • and import like this:
source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/scripts/install.sh | bash
or
source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/scripts/install.sh | bash -s -- latest
Notes:

this way, your script will access github to check whether a newer version published during every time it launched. if you don't like this behavior, you need to specify a fixed version to use in your script.

Using param verify to check all functions of bash-base is compatible with your environment:
source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/scripts/install.sh | bash -s -- latest verify
or
source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/scripts/install.sh | bash -s -- v2.3.3 verify
To uninstall all versions of bash-base from your system:
curl -o- -L https://raw.githubusercontent.com/zhang-hongjie/bash-base/master/scripts/install.sh | bash -s -- uninstall

Install from NPM

See npm repackage

npm install -g bash-base

verify the installation

man bash-base

or one line in your script:

# import, and install bash-base from npmjs only if not installed:
source bash-base 2>/dev/null || npm install -g bash-base && source bash-base

To uninstall:

npm uninstall -g bash-base

Install from docker

See docker hub

source <(docker run --rm zhj2074/bash-base)

Or specific a fixed version

source <(docker run --rm zhj2074/bash-base:2.3.2)

Download only

download a specific version:

  • from NPM: https://registry.npmjs.org/bash-base/-/bash-base-2.3.2.tgz
  • from github: https://github.com/zhang-hongjie/bash-base/archive/v2.3.3.tar.gz

Example

See example folder

Reference

See reference

Specification

See spec folder

Contributing

See How to contribute

License

MIT.