# create-debug

> A wrapper over `debug` library to display the module path as the tag.

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

## Install

```sh
npm install create-debug
pnpm add create-debug
yarn add create-debug
bun add create-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.3.0 |
| Published | 2020-04-27 |
| First published | 2020-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 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-debug
- Repository: https://github.com/rqbazan/create-debug
- Homepage: https://github.com/rqbazan/create-debug#readme
- Issues: https://github.com/rqbazan/create-debug/issues
- npm.io page: https://npm.io/package/create-debug

## Recent versions

- 0.3.0 (latest) — 2020-04-27
- 0.2.0 — 2020-04-24
- 0.1.3 — 2020-04-07
- 0.1.2 — 2020-04-07
- 0.1.1 — 2020-04-07
- 0.1.0 — 2020-04-07

## README

# CREATE DEBUG

A wrapper over `debug` library to display the module path as the tag.

### Installation

```
yarn add create-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-debug'

const configuration = {
  rootDir: 'dist',
  prefix: 'myapp',
}

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 world')
```

3. You will see the log in your terminal:

```sh
myapp:some:path:foo hello world
```

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