# prod-console

> Console wrapper for browsers that disables or enables the output

Latest version **1.0.0** (published 2019-12-03) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2019-12-03 |
| First published | 2019-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.10.9 |
| Dependencies | 0 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zakhar Kononov |
| Maintainers | zarkon |

## Links

- npm: https://www.npmjs.com/package/prod-console
- Repository: https://github.com/zorgick/prodConsole
- Homepage: https://github.com/zorgick/prodConsole#readme
- Issues: https://github.com/zorgick/prodConsole/issues
- npm.io page: https://npm.io/package/prod-console

## Recent versions

- 1.0.0 (latest) — 2019-12-03

## README

Enables or disables **console** output in the browser when needed.

It doesn't add new methods, nor deletes existing ones from the console object. Nor it makes console
behave identically across all browsers. It is a simple switcher. That's it (: 

Uses Reflect and Proxy objects.

And yea, frick IE! Let it die already, geeze ;P So no support for IE.

But if you still want to support IE or you are forced to do it, use [core-js@3](https://www.npmjs.com/package/core-js) for Reflect and [proxy-polyfill](https://www.npmjs.com/package/proxy-polyfill) for Proxy.

Zero dependency package! Yippee-ki-yay, motherfricker!

# Example

The most common use case for disabling console is for production mode in distributed teams, when someone uses a hideous way to debug the code with console.log and leaves it there

**Require the module**

```js
import consoleProxy from 'consoleProxy'
```

**Usage**

```js
const {NODE_ENV} = process.env
const prodConsole = consoleProxy({
  monitor: false // disables info message if console is turned off
})
NODE_ENV === 'production' && prodConsole.switchConsole('off')  
// or
NODE_ENV === 'production' && __prod_console__.switchConsole('off')

// to enable console output

prodConsole.switchConsole('on') || __prod_console__.switchConsole('on')
```

# [API](./docs/API.md)

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