项目作者: stacktracejs

项目描述 :
Extract meaning from JS Errors
高级语言: JavaScript
项目地址: git://github.com/stacktracejs/error-stack-parser.git
创建时间: 2013-12-07T23:23:28Z
项目社区:https://github.com/stacktracejs/error-stack-parser

开源协议:MIT License

下载


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

Build Status
Coverage Status
GitHub license
size with dependencies
gzip size
module format
me@eriwen.com">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

  1. ErrorStackParser.parse(new Error('BOOM'));
  2. => [
  3. StackFrame({functionName: 'foo', args: [], fileName: 'path/to/file.js', lineNumber: 35, columnNumber: 79, isNative: false, isEval: false}),
  4. StackFrame({functionName: 'Bar', fileName: 'https://cdn.somewherefast.com/utils.min.js', lineNumber: 1, columnNumber: 832, isNative: false, isEval: false, isConstructor: true}),
  5. StackFrame(... and so on ...)
  6. ]

Installation

  1. npm install error-stack-parser
  2. bower install error-stack-parser
  3. 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!