# nop

> library for providing a function that does nothing; it's like super useful

Latest version **1.0.0** (published 2014-10-23) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2014-10-23 |
| First published | 2012-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Ian Hansen |
| Maintainers | supershabam |
| Keywords | nop, noop, no-op, useless, wtf |

## Links

- npm: https://www.npmjs.com/package/nop
- Repository: https://github.com/supershabam/nop
- Issues: https://github.com/supershabam/nop/issues
- npm.io page: https://npm.io/package/nop

## Recent versions

- 1.0.0 (latest) — 2014-10-23
- 0.0.0 — 2012-09-12

## README

nop
===

a library for providing a javascript function that does nothing; it's like super useful

[![Build Status](https://secure.travis-ci.org/supershabam/nop.png?branch=master)](http://travis-ci.org/supershabam/nop)

[![endorse](http://api.coderwall.com/supershabam/endorsecount.png)](http://coderwall.com/supershabam)

use case
--------
Did you know every time you create a do-nothing no-op function you're consuming 
memory? You can literally save maybe a whole byte or two by using this nop library.

Anybody who cares about being efficient and doesn't care about being rediculous should use this library.

examples
-------

### default callback
```javascript
var nop = require('nop');

function example(options) {
  options = options || {};
  options.success = options.success || nop;
  options.error = options.error || nop;

  // do stuff
  options.success();
}
```

### feel like calling a function, but don't want it to do anything and don't want to create it myself
```javascript
var nop = require('nop');

var a = 'a';
var b = 'b';
// do you think I should call a function now?
var c = 'c';
// nah, I'll wait
var d = 'd';
var e = 'e';
var f = 'f';
// maybe now
nop();
var g = 'g';
// can I do another?
var h = 'h';
var j = 'j';
// sure... I guess
nop();
nop();
// hey, you were supposed to just do one
var i = 'i';
// sorry
var j = 'j';
// alright, then, as long as you're sorry
var k = 'ok';
```

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