Skip to main content
100%

neat-stack.js

✓ Published0🌍 Public
RRestuta
Last edited Mar 12, 2020
Created on Mar 12, 2020

This example shows a function that cleans and colorizes JavaScript stack traces, dimming non-useful log lines to make errors easier to read. It uses the `clean-stack` library to remove noise, then applies a regular expression to identify internal frames from `node_modules`, timers, promises, and webpack imports. Stack lines are split, with the title kept intact and remaining lines passed through a `R.pipe` from Ramda to map each line, using `chalk.dim` for ignored lines and `colorize` for others. The rendered output is a single string combining the title and processed lines, with a special check for “From previous event” lines.

AI-generated description

Similar vizzes