error-stack-parser

Extract meaning from JS Errors

Please upgrade to error-stack-parser >= v2.1.4, see https://github.com/stacktracejs/error-stack-parser/issues/80
Last updated 2 years ago by eriwen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install error-stack-parser 
SYNC missed versions from official npm registry.

error-stack-parser.js - Extract meaning from JS Errors

Build Status Coverage Status GitHub license size with dependencies gzip size module format code of conduct jsDelivr Hits

Simple, cross-browser Error parser. This library parses and extracts function names, URLs, line numbers, and column numbers from the given Error's stack as an Array of StackFrames.

Once you have parsed out StackFrames, you can do much more interesting things. See stacktrace-gps.

Note that in IE9 and earlier, Error objects don't have enough information to extract much of anything. In IE 10, Errors are given a stack once they're thrown.

Browser Support

Sauce Test Status

Usage

ErrorStackParser.parse(new Error('BOOM'));

=> [
        StackFrame({functionName: 'foo', args: [], fileName: 'path/to/file.js', lineNumber: 35, columnNumber: 79, isNative: false, isEval: false}),
        StackFrame({functionName: 'Bar', fileName: 'https://cdn.somewherefast.com/utils.min.js', lineNumber: 1, columnNumber: 832, isNative: false, isEval: false, isConstructor: true}),
        StackFrame(... and so on ...)
   ]

Installation

npm install error-stack-parser
bower install error-stack-parser
https://raw.githubusercontent.com/stacktracejs/error-stack-parser/master/dist/error-stack-parser.min.js

Contributing

Want to be listed as a Contributor? Start with the Contributing Guide!

Current Tags

  • 2.1.4                                ...           latest (2 years ago)
  • 1.3.3                                ...           next (9 years ago)

34 Versions

  • 2.1.4                                ...           2 years ago
  • 2.1.3 [deprecated]           ...           2 years ago
  • 2.1.2 [deprecated]           ...           2 years ago
  • 3.0.0 [deprecated]           ...           2 years ago
  • 2.1.1 [deprecated]           ...           2 years ago
  • 2.1.0 [deprecated]           ...           2 years ago
  • 2.0.7                                ...           3 years ago
  • 2.0.6                                ...           5 years ago
  • 2.0.5                                ...           5 years ago
  • 2.0.4                                ...           5 years ago
  • 2.0.3                                ...           5 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.3.6                                ...           8 years ago
  • 1.3.5                                ...           9 years ago
  • 1.3.4                                ...           9 years ago
  • 1.3.3                                ...           9 years ago
  • 1.3.2                                ...           9 years ago
  • 1.3.1                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.3                                ...           9 years ago
  • 1.2.2                                ...           9 years ago
  • 1.2.1                                ...           9 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.2                                ...           10 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.2.4                                ...           10 years ago
  • 0.2.3                                ...           10 years ago
  • 0.2.2                                ...           10 years ago
  • 0.2.1                                ...           10 years ago
  • 0.2.0                                ...           10 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE