Newtonian Physics Mockumentary

    v8stack

    0.1.1 • Public • Published

    v8stack is an npm package for accessing V8's error stack traces.

    Installation

    npm install v8stack
    

    Usage

    // Import the `v8stack` package
    var v8stack = require("v8stack");
     
    // Enable the capture of V8's stack traces
    v8stack.enable();
     
    // Access V8's stack trace of an error object
    var error = new Error();
    var errorStack = v8stack.evaluate(error);
    console.log(errorStack[0].getTypeName());
     
    // If wanted, the capture can be stopped
    v8stack.disable();
     
    // Beware that error stacks are evaluated lazily.
    // Evaluation can be triggered by calling `v8stack.get(error)`
    // or by evaluating `error.stack`.
    // After invoking `v8stack.disable()`, calls to `v8stack.evaluate(error)`
    // with errors whose stack evaluation hasn't been trigerred
    // will return 'undefined'.

    Install

    npm i v8stack

    DownloadsWeekly Downloads

    1

    Version

    0.1.1

    License

    BSD-3-Clause

    Last publish

    Collaborators

    • avatar