# @darkobits/skip-if-ignored

> Alternative implementation of NPM's ignore_scripts logic.

Latest version **0.2.0** (published 2021-06-06) · WTFPL license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @darkobits/skip-if-ignored
pnpm add @darkobits/skip-if-ignored
yarn add @darkobits/skip-if-ignored
bun add @darkobits/skip-if-ignored
```

Provides the command `skip-if-ignored`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2021-06-06 |
| First published | 2021-06-05 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | darkobits |
| Maintainers | darkobits |

## Links

- npm: https://www.npmjs.com/package/@darkobits/skip-if-ignored
- Repository: https://github.com/darkobits/skip-if-ignored
- Homepage: https://github.com/darkobits/skip-if-ignored#readme
- Issues: https://github.com/darkobits/skip-if-ignored/issues
- npm.io page: https://npm.io/package/@darkobits/skip-if-ignored

## Dependencies (3)

- [execa](https://npm.io/package/execa.md) ^5.1.1
- [@darkobits/env](https://npm.io/package/@darkobits/env.md) ^1.3.4
- [@darkobits/log](https://npm.io/package/@darkobits/log.md) ^2.0.0-beta.15

## Recent versions

- 0.2.0 (latest) — 2021-06-06
- 0.1.0 — 2021-06-05

## README

<a href="#top" id="top">
  <img src="https://user-images.githubusercontent.com/441546/120887671-178a0c00-c5a9-11eb-8c73-66220ef98e07.png" style="max-width: 100%;">
</a>
<p align="center">
  <a href="https://www.npmjs.com/package/@darkobits/skip-if-ignored"><img src="https://img.shields.io/npm/v/@darkobits/skip-if-ignored.svg?style=flat-square"></a>
  <a href="https://github.com/darkobits/skip-if-ignored/actions"><img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fdarkobits%2Fskip-if-ignored%2Fbadge%3Fref%3Dmaster&style=flat-square&label=build&logo=none"></a>
  <a href="https://depfu.com/github/darkobits/skip-if-ignored"><img src="https://img.shields.io/depfu/darkobits/skip-if-ignored?style=flat-square"></a>
  <a href="https://conventionalcommits.org"><img src="https://img.shields.io/static/v1?label=commits&message=conventional&style=flat-square&color=398AFB"></a>
</p>

Since becoming generally available to the public over a year ago, NPM 7 has had a regression wherein
the presence of the `--ignore-scripts` command-line flag (or the `ignore_scripts` configuration option)
is not honored when running other NPM commands. This package offers a very simplistic, interim
implementation of the `--ignore-scripts` behavior while the NPM team continue conducting their very
important research on the efficacy of quantum nano tube technology being a viable replacement for commas
in `package.json`.

# Install

In most cases, this package should be installed as a development dependency of your project:

```
npm install --save-dev @darkobits/skip-if-ignored
```

However, if you plan to use it in lifecycle scripts that run on the end user's computer, you'll need to
make it a production dependency:

```
npm install --save @darkobits/skip-if-ignored
```

# Use

What's in the box:

`skip-if-ignored` - A script that you may append to your package script expressions that will do
approximately the following:

```yaml
1. Is the current command being executed as part of an NPM lifecycle event?
2. If not, bail.
3. Is the current lifecycle "exempt"?
4. If so, run our command.
5. Else, is there an `--ignore-scripts` flag in `process.argv`?
6. If so, bail.
7. Else, run our command.
```

Note: This script will launch child processes in **detached mode** and then immediately exit.

## Example

Let us suppose we have a


something we

> `package.json`

```json


```


## Additional Resources

* [Official Documentation for The NPM CLI, Version 7](https://docs.npmjs.com/cli/v7)
* [`--ignore-scripts` Documentation](https://docs.npmjs.com/cli/v7/commands/npm-install-ci-test#ignore-scripts)
* **Bug Reports**
  * [#2434](https://github.com/npm/cli/issues/2434) – `--ignore-scripts` flag is being ignored by npm ci
  * [#2755](https://github.com/npm/cli/issues/2755) – Neither `--ignore-scripts` nor `--ignore-prepublish` are respected by npm publish


<a href="#top">
  <img src="https://user-images.githubusercontent.com/441546/118062198-4ff04e80-b34b-11eb-87f3-406a345d5526.png" style="max-width: 100%;">
</a>

---
_Source: https://npm.io/package/@darkobits/skip-if-ignored · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
