Socket
Book a DemoInstallSign in
Socket

@fatso83/stacktrace-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fatso83/stacktrace-cli

Show source-mapped line numbers

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

stacktrace-cli

Retroactively show a source mapped location from a error message

Example:

You have such an error in your logs:

https://localhost:56962/app-bundle.js 129:600036 TypeError: Cannot read property 'map' of undefined

If you download app-bundle.js and app-bundle.js.map you can get the original source lines like this:

$ npx @fatso83/stacktrace-cli app-bundle.js app-bundle.js.map 129:600036
{
    "columnNumber": 56,
    "lineNumber": 78,
    "fileName": "webpack:///src/store/entities/entities-reducer.js",
    "functionName": "getEntitiesById"
}
{
    "columnNumber": 56,
    "lineNumber": 78,
    "fileName": "webpack:///src/store/entities/entities-reducer.js",
    "functionName": "map"
}

getEntitiesById is the function the error was thrown. map was the symbol that caused it (undefined called as function).

Install

You don't need to install it now that we have npx (see example), but you can install it globally if you want to:

npm install -g @fatso83/stacktrace-cli

You can then call it as stacktrace-cli wherever you are.

How?

  • Stacktrace.js
  • Node HTTP
  • Puppeteer

Stacktrace.js is wonderful. In theory. When trying to use it, the docs are missing all the bits on how to get this running. This is my attempt at solving an itch that needed scratching.

This was literally hacked together in 3 hours, so feel free to extract, refactor and package it up as the sweet little thing it could have been.

FAQs

Package last updated on 30 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts