New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cstack

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cstack

Debug your code, not the Runtime

latest
Source
npmnpm
Version
0.3.4
Version published
Maintainers
1
Created
Source

CStack

Debug your code, not the Runtime

  • TypeScript supported
  • CommonJS (Node.js) supported
  • ECMAScript Modules (ESM) supported

npm-version npm-downloads

Table of Contents

Why

As a developer you'll often need to inspect call stacks to debug your code, not the Runtime. Tools like Error.stack() provide more information than needed, cluttering your call stack with Runtime internals (i.e. node:internals) which you don't care about; you're only concerned with your code.

Installation

npm i cstack # includes type definitions for TypeScript support

Example

import cstack from "cstack";

function firstCall() {
  console.debug("1");
  secondCall();
}

function secondCall() {
  console.debug("2");
  thirdCall();
}

function thirdCall() {
  console.debug("3");
  console.log(cstack.getStack()); // -> StackFrame[]
  console.log(cstack.getParent("secondCall")); // -> "firstCall"
  console.log(cstack.getTrace(true)); // -> reversed stack trace (chronological)
}

firstCall();

License

MIT License

Keywords

callstack

FAQs

Package last updated on 15 Jul 2023

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