# debug-to-file

> [debug-to-file](http://github.com/131/debug-to-file) is tiny, no dependecy helper to dump [debug](http://github.com/visionmedia/debug) traces to a file (through `DEBUG_FILE` env var).

Latest version **1.0.9** (published 2018-05-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install debug-to-file
pnpm add debug-to-file
yarn add debug-to-file
bun add debug-to-file
```

## 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.9 |
| Published | 2018-05-18 |
| First published | 2017-06-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | 131, frodon |

## Links

- npm: https://www.npmjs.com/package/debug-to-file
- npm.io page: https://npm.io/package/debug-to-file

## Dependencies (1)

- [ms](https://npm.io/package/ms.md) ^2.0.0

## Recent versions

- 1.0.9 (latest) — 2018-05-18
- 1.0.8 — 2018-03-09
- 1.0.7 — 2018-03-09
- 1.0.4 — 2017-06-13
- 1.0.3 — 2017-06-13
- 1.0.2 — 2017-06-13
- 1.0.1 — 2017-06-13
- 1.0.0 — 2017-06-12

## README

[debug-to-file](http://github.com/131/debug-to-file) is tiny, no dependecy  helper to dump [debug](http://github.com/visionmedia/debug) traces to a file (through `DEBUG_FILE` env var).

[debug-to-file](http://github.com/131/debug-to-file) also allows you to customize debug output format using the `DEBUG_FORMAT`.

[![Build Status](https://travis-ci.org/131/debug-to-file.svg?branch=master)](https://travis-ci.org/131/debug-to-file)
[![Version](https://img.shields.io/npm/v/debug-to-file.svg)](https://www.npmjs.com/package/debug-to-file)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)






# DEBUG_FILE 
Declare env DEBUG_FILE as the debug-to-file  target


# Available format for DEBUG_FORMAT
* use :time for ISO timestamp
* use :namespace for debug namespace
* use :body for main payload
* use :diff for last msg diff


Defaut DEBUG_FORMAT is ":time :namespace :body"

# Support for console.log/console.error
debug-to-file will duplex everything to the console into the trace file

# Support for debug
debug-to-file will overrite debug.log (per specifications) to a dedicated file

# Browserify recommandation
Exclude debug from browserify is a good way to make sure only one debug reference is loaded.

# Credits
* [131](https://github.com/131) author
* [debug](https://github.com/visionmedia/debug)

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