https://github.com/eviltik/evildebug
nodejs lazy debug module using TJ Holowaychuk debug module
https://github.com/eviltik/evildebug
Last synced: 11 months ago
JSON representation
nodejs lazy debug module using TJ Holowaychuk debug module
- Host: GitHub
- URL: https://github.com/eviltik/evildebug
- Owner: eviltik
- License: mit
- Created: 2021-02-01T08:35:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-01T19:39:23.000Z (over 5 years ago)
- Last Synced: 2025-09-01T02:01:50.405Z (11 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# evildebug
[](https://badge.fury.io/js/evildebug)
[](https://opensource.org/licenses/mit-license.php)
[](https://david-dm.org/eviltik/evildebug)
Nodejs lazy debug module based on Holowaychuk debug module
-------------------------------------------------------------
## Installation
```bash
$ npm install evildebug
```
## Motivations
I like to have the project name followed by the current filename by default (without file extension)
Example code using native debug module
------------------------------------
```js run.js
process.env.DEBUG = '*';
const pkg = require('./package.json');
const path = require('path');
const debug = require('debug')(`${pkg.name}:${path.basename(__filename).replace(/\.js$/, '')}`);
debug('foo');
```
will output
```bash
myproject:run foo +0ms
```
Example code using evildebug module
--------------------------------------
```js run.js
process.env.DEBUG = '*';
const debug = require('evildebug');
debug('foo');
```
will output
```bash
myproject:run foo +0ms
```