JSPM

code-preview-from-error

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 450
  • Score
    100M100P100Q94658F
  • License MIT

Generates a preview of the part of the code where an Error came from

Package Exports

  • code-preview-from-error
  • code-preview-from-error/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (code-preview-from-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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