parstack

0.0.1 • Public • Published

Example:

var parstack = require("parstack");
 
var obj = parstack(new Error("hello\nworld at test"));
 
 
console.log(JSON.stringify(obj, null, 2));

Output:

{
  "message": "Error: hello\nworld at test",
  "stack": [
    {
      "source": "Object.<anonymous>",
      "file": "/Users/craig/Dropbox/Developer/Public/stacktrace2json.js/examples/index.js",
      "line": "3",
      "col": "19"
    },
    {
      "source": "Module._compile",
      "file": "module.js",
      "line": "411",
      "col": "26"
    },
    {
      "source": "Object..js",
      "file": "module.js",
      "line": "417",
      "col": "10"
    },
    {
      "source": "Module.load",
      "file": "module.js",
      "line": "343",
      "col": "31"
    },
    {
      "source": "Function._load",
      "file": "module.js",
      "line": "302",
      "col": "12"
    },
    {
      "source": "Array.0",
      "file": "module.js",
      "line": "430",
      "col": "10"
    },
    {
      "source": "EventEmitter._tickCallback",
      "file": "node.js",
      "line": "126",
      "col": "26"
    }
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i parstack

Weekly Downloads

4

Version

0.0.1

License

none

Last publish

Collaborators

  • architectd
  • crcn