# create-winston-debug

> Create a debug function similar to the debug package, but using the Winston Console Transport

Latest version **0.1.1** (published 2020-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-winston-debug
pnpm add create-winston-debug
yarn add create-winston-debug
bun add create-winston-debug
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-04-27 |
| First published | 2020-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ricardo Alexis Quiroz Bazan |
| Maintainers | rqbazan |

## Links

- npm: https://www.npmjs.com/package/create-winston-debug
- Repository: https://github.com/rqbazan/create-winston-debug
- Homepage: https://github.com/rqbazan/create-winston-debug#readme
- Issues: https://github.com/rqbazan/create-winston-debug/issues
- npm.io page: https://npm.io/package/create-winston-debug

## Dependencies (1)

- [create-debug](https://npm.io/package/create-debug.md) ^0.3.0

## Recent versions

- 0.1.1 (latest) — 2020-04-27
- 0.1.0 — 2020-04-27
- 0.0.1 — 2020-04-27

## README

# CREATE WINSTON DEBUG

Create a debug function similar to the [`debug`](https://www.npmjs.com/package/debug) package, but using the Winston Console Transport

### Installation

```
yarn add create-winston-debug
```

### Usage

1. Create a dedicated module to avoid pass your specific configuration to the library.

```js
// src/debug.js
import { createDebug as _createDebug } from 'create-winston-debug'

const configuration = {
  prefix: 'myapp',
  rootDir: 'dist', // I assuming that you're using Babel
  debug: 'myapp:*', // default is process.env.DEBUG
}

export function createDebug(module) {
  return _createDebug(module, configuration)
}
```

2. Use the above module in your base code such as here:

```js
// src/some/path/foo.js
import { createDebug } from '~/debug'

const debug = createDebug(module)

debug('Hello There')
```

3. You will see the log in your terminal:

```sh
[myapp:some:path:foo] 2020-04-27T21:20:48.571+00:00: Hello There +0ms
```

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