{
  "manifest": {
    "name": "stack-utils",
    "version": "2.0.6",
    "description": "Captures and cleans stack traces",
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/tapjs/stack-utils.git"
    },
    "author": {
      "name": "James Talmage",
      "email": "james@talmage.io",
      "url": "github.com/jamestalmage"
    },
    "engines": {
      "node": ">=10"
    },
    "scripts": {
      "test": "tap",
      "preversion": "npm test",
      "postversion": "npm publish",
      "prepublishOnly": "git push origin --follow-tags"
    },
    "tap": {
      "check-coverage": true
    },
    "files": [
      "index.js"
    ],
    "dependencies": {
      "escape-string-regexp": "^2.0.0"
    },
    "devDependencies": {
      "bluebird": "^3.7.2",
      "coveralls": "^3.0.9",
      "nested-error-stacks": "^2.1.0",
      "pify": "^4.0.1",
      "q": "^1.5.1",
      "source-map-support": "^0.5.20",
      "tap": "^16.3.0"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-stack-utils-2.0.6-aaf0748169c02fc33c8232abccf933f54a1cc34f-integrity/node_modules/stack-utils/package.json",
    "readmeFilename": "readme.md",
    "readme": "# stack-utils \n\n> Captures and cleans stack traces.\n\n[![Linux Build](https://travis-ci.org/tapjs/stack-utils.svg?branch=master)](https://travis-ci.org/tapjs/stack-utils) [![Build status](https://ci.appveyor.com/api/projects/status/fb9i157knoixe3iq/branch/master?svg=true)](https://ci.appveyor.com/project/jamestalmage/stack-utils-oiw96/branch/master)  [![Coverage](https://coveralls.io/repos/tapjs/stack-utils/badge.svg?branch=master&service=github)](https://coveralls.io/github/tapjs/stack-utils?branch=master)\n\n\nExtracted from `lib/stack.js` in the [`node-tap` project](https://github.com/tapjs/node-tap)\n\n## Install\n\n```\n$ npm install --save stack-utils\n```\n\n\n## Usage\n\n```js\nconst StackUtils = require('stack-utils');\nconst stack = new StackUtils({cwd: process.cwd(), internals: StackUtils.nodeInternals()});\n\nconsole.log(stack.clean(new Error().stack));\n// outputs a beautified stack trace\n```\n\n\n## API\n\n\n### new StackUtils([options])\n\nCreates a new `stackUtils` instance.\n\n#### options\n\n##### internals\n\nType: `array` of `RegularExpression`s  \n\nA set of regular expressions that match internal stack stack trace lines which should be culled from the stack trace.\nThe default is `StackUtils.nodeInternals()`, this can be disabled by setting `[]` or appended using\n`StackUtils.nodeInternals().concat(additionalRegExp)`.  See also `ignoredPackages`.\n\n##### ignoredPackages\n\nType: `array` of `string`s\n\nAn array of npm modules to be culled from the stack trace.  This list will mapped to regular\nexpressions and merged with the `internals`.\n\nDefault `''`.\n\n##### cwd\n\nType: `string`\n\nThe path to the current working directory. File names in the stack trace will be shown relative to this directory.\n\n##### wrapCallSite\n\nType: `function(CallSite)`\n\nA mapping function for manipulating CallSites before processing. The first argument is a CallSite instance, and the function should return a modified CallSite. This is useful for providing source map support.\n\n\n### StackUtils.nodeInternals()\n\nReturns an array of regular expressions that be used to cull lines from the stack trace that reference common Node.js internal files.\n\n\n### stackUtils.clean(stack, indent = 0)\n\nCleans up a stack trace by deleting any lines that match the `internals` passed to the constructor, and shortening file names relative to `cwd`.\n\nReturns a `string` with the cleaned up stack (always terminated with a `\\n` newline character).\nSpaces at the start of each line are trimmed, indentation can be added by setting `indent` to the desired number of spaces.\n\n#### stack\n\n*Required*  \nType: `string` or an `array` of `string`s\n\n\n### stackUtils.capture([limit], [startStackFunction])\n\nCaptures the current stack trace, returning an array of `CallSite`s. There are good overviews of the available CallSite methods [here](https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces), and [here](https://github.com/sindresorhus/callsites#api).\n\n#### limit\n\nType: `number`\nDefault: `Infinity`\n\nLimits the number of lines returned by dropping all lines in excess of the limit. This removes lines from the stack trace.\n\n#### startStackFunction\n\nType: `function`\n\nThe function where the stack trace should start. The first line of the stack trace will be the function that called `startStackFunction`. This removes lines from the end of the stack trace.\n\n\n### stackUtils.captureString([limit], [startStackFunction])\n\nCaptures the current stack trace, cleans it using `stackUtils.clean(stack)`, and returns a string with the cleaned stack trace. It takes the same arguments as `stackUtils.capture`.\n\n\n### stackUtils.at([startStackFunction])\n\nCaptures the first line of the stack trace (or the first line after `startStackFunction` if supplied), and returns a `CallSite` like object that is serialization friendly (properties are actual values instead of getter functions). \n\nThe available properties are:\n\n - `line`: `number` \n - `column`: `number`\n - `file`: `string`\n - `constructor`: `boolean`\n - `evalOrigin`: `string`\n - `native`: `boolean`\n - `type`: `string`\n - `function`: `string`\n - `method`: `string`\n\n### stackUtils.parseLine(line)\n\nParses a `string` (which should be a single line from a stack trace), and generates an object with the following properties:\n\n - `line`: `number` \n - `column`: `number`\n - `file`: `string`\n - `constructor`: `boolean`\n - `evalOrigin`: `string`\n - `evalLine`: `number`\n - `evalColumn`: `number`\n - `evalFile`: `string`\n - `native`: `boolean`\n - `function`: `string`\n - `method`: `string`\n\n\n## License\n\nMIT © [Isaac Z. Schlueter](http://github.com/isaacs), [James Talmage](http://github.com/jamestalmage)\n",
    "licenseText": "The MIT License (MIT)\n\nCopyright (c) 2016-2022 Isaac Z. Schlueter <i@izs.me>, James Talmage <james@talmage.io> (github.com/jamestalmage), and Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz",
    "hash": "aaf0748169c02fc33c8232abccf933f54a1cc34f",
    "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==",
    "registry": "npm",
    "packageName": "stack-utils",
    "cacheIntegrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== sha1-qvB0gWnAL8M8gjKrzPkz9Uocw08="
  },
  "registry": "npm",
  "hash": "aaf0748169c02fc33c8232abccf933f54a1cc34f"
}