# mockconsole

> An object with all the same methods as console in the browser. But does nothing.

Latest version **0.0.1** (published 2013-07-21) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2013-07-21 |
| First published | 2013-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Henrik Joreteg |
| Maintainers | henrikjoreteg |
| Keywords | browser, console, logging |

## Links

- npm: https://www.npmjs.com/package/mockconsole
- Repository: https://github.com/HenrikJoreteg/mockconsole
- npm.io page: https://npm.io/package/mockconsole

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2013-07-21

## README

# mockconsole

## What is this?

A tiny browser module that builds and returns an object with the same methods as `console` but with no-op functions.

Suitable for use with browserify/CommonJS on the client. 

If you want to use as a standalone or with AMD use mockconsole.umd.js.

Can be handy for modules that export constructors where you wnat to be able to pass in a logger as an option.

## Installing

```
npm install mockconsole
```

## Demo / How to use it


```js
var mockconsole = require('mockconsole');


// this way someone can pass in `window.console` or something
// like github.com/latentflip/bows as the logger for logging
// If it's not passed in no code needs to change.
function Human(options) {
    this.console = options.logger || mockconsole;
}

Human.prototype.dance = function () {
    this.console.log('dance human!');   
};
```

## License

MIT

## Created By

If you like this, follow: [@HenrikJoreteg](http://twitter.com/henrikjoreteg) on twitter.

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