# debuggler

> Resolves debug namespace like magic.

Latest version **1.0.0** (published 2018-04-18) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## 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 | 2018-04-18 |
| First published | 2018-04-17 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 2 |
| Unpacked size | 108.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rodrigogs |
| Keywords | debug, log, debugger, automatic, wrapper |

## Links

- npm: https://www.npmjs.com/package/debuggler
- npm.io page: https://npm.io/package/debuggler

## Dependencies (2)

- [pkg-up](https://npm.io/package/pkg-up.md) ^2.0.0
- [caller-path](https://npm.io/package/caller-path.md) ^2.0.0

## 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

- 1.0.0 (latest) — 2018-04-18
- 1.0.0-BETA — 2018-04-18
- 1.1.1-ALPHA — 2018-04-17
- 1.0.2-ALPHA — 2018-04-17
- 1.0.1-ALPHA — 2018-04-17
- 1.0.0-ALPHA — 2018-04-17

## README

# debuggler

[![Build Status](https://travis-ci.org/rodrigogs/debuggler.svg?branch=master)](https://travis-ci.org/rodrigogs/debuggler)
[![Code Climate](https://codeclimate.com/github/rodrigogs/debuggler/badges/gpa.svg)](https://codeclimate.com/github/rodrigogs/debuggler)
[![Test Coverage](https://codeclimate.com/github/rodrigogs/debuggler/badges/coverage.svg)](https://codeclimate.com/github/rodrigogs/debuggler/coverage)

**debuggler** is a [visionmedia/debug](https://github.com/visionmedia/debug) wrapper that is able to resolves it's caller path and package.json information,
so it needs no configuration.

### Install
```bash
$ npm install debuggler
```

### Usage
```javascript
/**
 * /home/example/package.json 
 *   name: example
 *   version: 1.0.0
 * /home/example/foo/bar.js
 */
process.env.DEBUG = 'example*';

const debug = require('debuggler')({ version: true });

debug('I know where I am!');
// Should output: example@1.0.0:foo:bar I know where I am!
```

### API
| Argument               | Type            | Default Value | Description                                                          |
|------------------------|-----------------|---------------|----------------------------------------------------------------------|
| options                | String\|Object  | `{}`          | Debug namespace string or an options object.                         |
| options.namespace      | String          | `undefined`   | Namespace is just passed to debug module, other options are ignored. |
| options.name           | String          | `true`        | Project name or true to get it from package.json.                    |
| options.version        | String\|Boolean | `false`       | Version string or true to get it from package.json.                  |
| options.verSeparator   | String          | `'@'`         | Version separator character.                                         |
| options.dirSeparator   | String          | `':'`         | Directory separator character.                                       |
| options.file           | String\|Boolean | `true`        | File name or true to get the current one.                            |
| options.ext            | String\|Boolean | `false`       | File extension or true to get the current one.                       |

### License
[Licence](https://github.com/rodrigogs/debuggler/blob/master/LICENSE) © Rodrigo Gomes da Silva

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