suppress-exit-code

3.2.0 • Public • Published

suppress-exit-code

Cross-platform CLI wrapper that runs any command and exits with zero

npm

## exits with non-zero
crazy-broken-command --some-arg=42

## exits with zero, stdout and stderr streams are kept as is
suppress-exit-code crazy-broken-command --some-arg=42

Motivation: https://github.com/okonet/lint-staged/issues/616

Installation

Local

npm install --dev suppress-exit-code
## or
yarn add --dev suppress-exit-code
## or
pnpm add --dev suppress-exit-code

Global

npm install --global suppress-exit-code
## or
yarn global add suppress-exit-code
## or
pnpm add --global suppress-exit-code

Possible improvements

Feel free to contribute with a PR if you need these extra features (they are possible, but are not implemented yet):

## keep exit code unless it matches a given whitelist
suppress-exit-code --only=1,2,3 crazy-broken-command --some-arg=42
## make sure nothing is ever printed to the standard error stream
## (helps when running a subcommand in sensible environments)
suppress-exit-code --stderr=pipe-to-stdout crazy-broken-command --some-arg=42
suppress-exit-code --stderr=suppress crazy-broken-command --some-arg=42

/suppress-exit-code/

    Package Sidebar

    Install

    npm i suppress-exit-code

    Weekly Downloads

    25,901

    Version

    3.2.0

    License

    MIT

    Unpacked Size

    5.39 kB

    Total Files

    4

    Last publish

    Collaborators

    • kachkaev