code-preview-from-error
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

code-preview-from-error

Preview the code an Error came from

This module:

  • Parses an Error's stack property
  • Identifies its location on disk
  • If that file exists, it reads it
  • Then, it creates a nice string with colors that shows the part of the file where the error was thrown from.

Sample output string:

sample output of code-preview-from-error

License

MIT

Package Sidebar

Install

npm i code-preview-from-error

Weekly Downloads

32

Version

1.0.2

License

MIT

Unpacked Size

6.63 kB

Total Files

6

Last publish

Collaborators

  • suchipi