stuck

1.0.0 • Public • Published

stuck

NPM Version NPM Downloads Build Status Coverage Status Dependency Status

Make all values on the current stack available.

This is a debugging utility. Don’t rely on it for anything else.

It requires the Node.js Inspector API, which is available in Node.js 8 and above, and is considered experimental at the time of writing (November 2017).

Install: npm install stuck

const stuck = require('stuck');
 
const stack = stuck();  // Array of stack frames.
const frame = stack[0];
console.log(`${frame.functionName} at ${frame.url}:${frame.column}:${frame.line}`);
const scopes = stack[0].scopes;  // Array of scopes.
const scope = scopes[0];
console.log(scope.type);  // One of: local, global, block, closure.
console.log(scope.object);  // Object with scope variables as properties.

License

MIT

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i stuck

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • addaleax