By using Fast Debugger
, you can expedite the process of troubleshooting NodeJS code and resolving issues.
First install Fast Debugger
desktop application according your operating system.
Now you are ready to receive log data from Laravel
or Node
projects.
npm i fast-debugger --save-dev
To use Fast Debugger first require or import fast-debugger
// es module import:
import { fast, exceptionHandler } from 'fast-debugger';
// commonjs import:
const { fast, exceptionHandler } = require('fast-debugger');
To log your data
fast('FAST DEBUGGER IS WORKING');
You can specify flag to identify your specific log by chainig flag()
method
fast('FAST DEBUGGER IS WORKING').flag('FLAG TO IDENTIFY');
On log data you can see file name and line number from the fast()
method is called. You can open file in VSCODE
by simply clicking on file name.
If want to use fast()
method without require
or import
statement. You can achieve this by global
scope.
Note: Be very careful with this approach
In your entry file mostly is index.js
const { fast } = require('fast-debugger');
global.fast = fast;
To handle or capture Exceptions. Here we have Express.js
example. Create a middleware to handle exceptions.
const { exceptionHandler } = require('fast-debugger');
module.exports = (_err, _req, _res, _next) => {
exceptionHandler(_err);
};