# noop-console

> noop console, replace console method calls with noops

Latest version **0.9.0** (published 2021-10-31) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2021-10-31 |
| First published | 2016-09-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | goliatone |
| Maintainers | goliatone |

## Links

- npm: https://www.npmjs.com/package/noop-console
- Repository: https://github.com/goliatone/noop-console
- Issues: https://github.com/goliatone/noop-console/issues
- npm.io page: https://npm.io/package/noop-console

## Recent versions

- 0.9.0 (latest) — 2021-10-31
- 0.8.0 — 2019-07-14
- 0.7.0 — 2019-03-22
- 0.6.0 — 2019-01-14
- 0.5.0 — 2019-01-12
- 0.4.0 — 2016-11-27
- 0.3.0 — 2016-11-27
- 0.2.0 — 2016-11-27
- 0.1.0 — 2016-09-02

## README

# Noop Console

JavaScript [nop][wiki] console, replace console method calls with no-operations.

Useful to silence all logging- i.e. during testing- or just from one module.

## Getting Started

Install the module with: `npm install noop-console`

## Examples
Mute global `console`:

```js
require('noop-console')(console);
```

Later if you want to restore the console, you can restore it by calling:

```js
console._restore();
```

If you create abstract modules with a `logger` property that references the standard console so that the actual logger implementation is defined outside the module, you can override this with a `noop-console`.

`module.js`:
```js
function MyModule(){}
MyModule.prototype.logger = console;
```

`my_test.js`:
```javascript
var MyModule = require('./module');
MyModule.prototype.logger = require('noop-console')();
```

## Release History

* 2019-01-11 v.0.5.0: Small refactoring and clean up.
* 2016-11-24 v.0.4.0: Added `_restore`.
* 2016-11-23 v.0.3.0: Take in `console` reference to mute.
* 2016-09-02 v.0.1.0: Initial release.

## License
Copyright (c) 2016 goliatone  
Licensed under the MIT license.


[wiki]: https://en.wikipedia.org/wiki/NOP

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