JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6694
  • Score
    100M100P100Q132832F
  • License MIT

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

Package Exports

  • suppress-exit-code
  • suppress-exit-code/main.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (suppress-exit-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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