From 34b7e56c03d733284614073158403f183d496976 Mon Sep 17 00:00:00 2001 From: Tim Ruffles Date: Mon, 5 Jun 2017 11:43:33 +0100 Subject: [PATCH] document .enabled flag Was added in #15, should be documented (e.g #423) --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index f67be6b3..15f2a17e 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,18 @@ error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` +## Checking whether a debug target is enabled + +Afer you've created a debug instance, you can check whether it is enabled by its `.enabled` property: + +```javascript +const debug = require('debug')('http'); + +if(debug.enabled) { + // ... +} +``` + ## Authors