Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

error-stack-parser-es

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-stack-parser-es

Cross-browser Error parser

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
783K
increased by0.41%
Maintainers
1
Weekly downloads
 
Created
Source

error-stack-parser-es

NPM version

A port of stacktracejs/error-stack-parser, rewrite with TypeScript and ES Modules.

Usage

import { parse } from 'error-stack-parser-es'

const stacktrace = parse(new Error('BOOM!'))

Refer to stacktracejs/error-stack-parser for more details.

Lite API

Additionally, this fork added a lite version of the API representation for the stack frames. You can import it from error-stack-parser-es/lite. For example, line and col instead of lineNumber and columnNumber.

import { parse } from 'error-stack-parser-es/lite'

const stacktrace = parse(new Error('BOOM!'))
// [{ file: 'file.js', name: 'method', line: 1, col: 2}]

It also allows you to parse directly from a stacktrace string (which does not support Opera stacktrace format).

import { parseStack } from 'error-stack-parser-es/lite'

const stacktrace = parseStack('Error\n    at method (file.js:1:2)')
// [{ file: 'file.js', name: 'method', line: 1, col: 2}]

License

MIT License © 2023-PRESENT Anthony Fu MIT License © 2017 Eric Wendelin

FAQs

Package last updated on 17 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc