errorstacks
Parse error stack traces
Last updated a year ago by marvinhagemeister .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install errorstacks 
SYNC missed versions from official npm registry.

errorstacks

Simple parser for Error stack traces.

Currently supported browsers/platforms:

  • Firefox
  • Chrome
  • Edge
  • Node

Usage

Install errorstacks via your package manager of choice. Here we'll use npm.

npm install errorstacks

Example code:

import { parseStackTrace } from 'errorstacks';

function foo() {
  throw new Error('fail');
}

try {
  foo();
} catch (err) {
  const parsed = parseStackTrace(err.stack);
  console.log(parsed);
  // Logs:
  // [
  //   {
  //     line: 4,
  //     column: 8,
  //     type: '',
  //     name: 'foo',
  //     raw: '    at foo (/my-project/foo.ts:4:8)'
  //   },
  // ]

Note: type will be the string "native" if native code execution was detected.

License

MIT, see the license file

Current Tags

  • 2.4.1                                ...           latest (a year ago)

18 Versions

  • 2.4.1                                ...           a year ago
  • 2.4.0                                ...           3 years ago
  • 2.3.2                                ...           4 years ago
  • 2.3.1                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.4                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Total 17
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (12)
Dependents (0)
None

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