# metalsmith-debug

> A Metalsmith plugin to debug Metalsmith and plugins

Latest version **1.2.0** (published 2017-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install metalsmith-debug
pnpm add metalsmith-debug
yarn add metalsmith-debug
bun add metalsmith-debug
```

## 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.2.0 |
| Published | 2017-11-15 |
| First published | 2014-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Eugeny Vlasenko |
| Maintainers | mahnunchik |
| Keywords | metalsmith, debug |

## Links

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

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [multimatch](https://npm.io/package/multimatch.md) ^2.1.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.2.0 (latest) — 2017-11-15
- 1.1.0 — 2016-06-15
- 1.0.0 — 2016-04-28
- 0.0.2 — 2014-07-02
- 0.0.1 — 2014-07-02

## README

# metalsmith-debug

A Metalsmith plugin to debug Metalsmith and plugins. It is a thin wrapper around [debug](https://github.com/visionmedia/debug) making use of its namespaces and logging functionality.

## Installation

```
$ npm install metalsmith-debug --save
```

## CLI Usage

Install via npm and then add the `metalsmith-debug` key to your `metalsmith.json`:

```json
{
  "plugins": {
    "metalsmith-debug": {}
  }
}
```

## Available namespaces

Available namespaces defined by `metalsmith-debug` are:

* metalsmith:source
* metalsmith:destination
* metalsmith:metadata
* metalsmith:files
* metalsmith:log

To see debug messages, you must set a `DEBUG` environment variable to the desired namespaces.

For all debug messages you can define:

```
$ DEBUG=metalsmith:* metalsmith
```

Or you can use namespaces to see only necessary messages:

```
$ DEBUG=metalsmith:files metalsmith
```

If you want to debug a specific plugin you must name it:

```
$ DEBUG=metalsmith-collections metalsmith
```

You can specify multiple namespaces to debug by separating them with commas:

```
$ DEBUG=metalsmith:source,metalsmith-collections metalsmith
```

## Javascript Usage

Pass `metalsmith-debug` plugin to Metalsmith with the `use` method:

```js
var debug = require('metalsmith-debug');

metalsmith.use(debug());
```

## Options

In case you want to use `.use(debug())` several times in your Metalsmith chain you have some options to switch off some of the `metalsmith:*` namespaces. Additionally, you can add some arbitrary log text. Furthermore you can apply file matching if you only want to monitor certain files. The `match` option is based on the globbing patterns implemented by [multimatch](https://github.com/sindresorhus/multimatch).

```js
var debug = require('metalsmith-debug');

metalsmith.use(debug({
  log: "first debug",      // any comment you like
  metadata: false,         // default: true
  source: false,           // default: true
  destination: false,      // default: true
  files: true,             // default: true
  match: "**/*.md"         // default: all files
}));
```



## License

[MIT](https://github.com/mahnunchik/metalsmith-debug/blob/master/LICENSE)

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