# noop

> Provides a few global functions such as `noop`, `throwop`, and `doop`

Latest version **1.0.1** (published 2021-08-28) · MIT OR CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install noop
pnpm add noop
yarn add noop
bun add noop
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-08-28 |
| First published | 2011-01-11 |
| Weekly downloads | 0 |
| License | MIT OR CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | AJ ONeal |
| Maintainers | coolaj86 |
| Keywords | util, noop, throwop, doop, no-op |

## Links

- npm: https://www.npmjs.com/package/noop
- Repository: https://github.com/coolaj86/noop.js
- Homepage: https://github.com/coolaj86/noop.js#readme
- Issues: https://github.com/coolaj86/noop.js/issues
- npm.io page: https://npm.io/package/noop

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-08-28
- 1.0.0 — 2021-08-28
- 0.2.2 — 2011-02-27
- 0.2.0 — 2011-01-11

## README

# node-noop

Provides a few global functions such as `noop`, `throwop`, and `doop`

```bash
npm install noop@v1
```

```js
require("noop");
```

# Features

- [x] Works with Promises and Thunks
- [x] Faster than `Object` (always `true`-y)
- [x] More predictable than `Boolean` (sometimes `false`-y)
- [x] Linted with TypeScript, JSHint, and Prettier

# API

## `global.noop`

Does nothing

```js
function noop() {}
```

## `global.throwop(err)`

Throws if `err` is `true`-y

```js
function throwop(err) {
  if (err) {
    throw err;
  }
}
```

## `global.doop(callback)`

Calls `callback` or `noop`

```js
function doop(callback, args, context) {
  if ("function" === typeof callback) {
    callback.apply(context, args);
  }
}
```

Similar function signature to `setTimeout`.

# LICENSE

MIT OR CC0-1.0 (Public Domain)

Written in 2011 by AJ ONeal <coolaj86@gmail.com> \
To the extent possible under law, the author(s) have dedicated all copyright \
and related and neighboring rights to this software to the public domain \
worldwide. This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with \
this software. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.

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