# console-wrapper

> よくあるconsoleのラッパー

Latest version **1.1.0** (published 2015-12-04) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-12-04 |
| First published | 2015-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | honeo |
| Maintainers | honeo |
| Keywords | console, wrapper |

## Links

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

## Recent versions

- 1.1.0 (latest) — 2015-12-04
- 1.0.0 — 2015-11-24

## README

## なにこれ
よくあるconsoleラッパー。  
require()のキャッシュを利用して同ディレクトリ内モジュールのコンソール動作を一括設定する。  
[honeo/console-wrapper](https://github.com/honeo/console-wrapper)  
[console-wrapper](https://www.npmjs.com/package/console-wrapper)

## 使い方
```sh
$ npm i console-wrapper
```
```js
const console = require('console-wrapper');

console.log('hoge'); // no output

console.enable();
console.log('hoge'); //"hoge"
```
Method
-----
### .enable()
有効化。  
通常のconsoleメソッドを使う。
### .disable()
標準。  
無効化、何もしないダミー関数を使う。
### .extension({...})
有効化（拡張モード）、行数が表示されなくなる代わりに……。  
.cache: trueならコンソールメソッド実行時に引数を保存する。  
.callback: 関数ならコンソールメソッド実行時に引数を渡して実行する。  
.disable: trueならコンソールメソッドは実行しない。  
.result: trueならコンソールメソッド実行後に引数を配列に入れて返す。
```js
// example
console.ext({
    cache: false,
    callback({type, arguments}){},
    disable: false,
    result: false
});
```
### .sync.method();
既に動作モードが設定されていればそのまま。  
されていなければ.method()を実行する。

## Properties
### .cache
.ext({cache: true}) 時にコンソールメソッド実行時の引数が配列で保存される。  
メモリに注意。  
### ._console
ネイティブのconsoleオブジェクトへの参照。

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