GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - stacklynjs/stacklyn: Stacklyn is a zero-dependency, cross-engine, JavaScript stack trace parser.

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
docs-temp
docs-temp
 
 
images
images
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
build.js
build.js
 
 
package.json
package.json
 
 
stacklyn.js
stacklyn.js
 
 
stacklyn.mjs
stacklyn.mjs
 
 

Repository files navigation

Stacklyn

Turn JavaScript stack traces into structured data.
Supports V8, SpiderMonkey, JavaScriptCore, Carakan, Internet Explorer, and more.

npm install stacklyn

npm Gzipped: 7.5 kB License: Apache-2.0


Getting Started

Live demo is at https://stacklynjs.github.io/demo. Some docs are at /docs-temp, this will do for now, note that some stuff isnt there yet.

First and foremost, npm install stacklyn.
(and/or use one of the direct import methods listed below)

Here's some example usage code:

import Stacklyn from "stacklyn";

try {
    // some risky code here that might throw an error
} catch (error) {
    // array of objects
    const parsed = Stacklyn.parse(error);

    // still an array of objects, but with source map info
    const mapped = Stacklyn.map(parsed);

    mapped.forEach(frame => console.log(frame.raw)); // log the sourcemapped stack frames
}

What we offer:

  • Stacktrace Parsing: Convert raw and hard to read stack strings into clean, structured data.
  • Stacktrace Stringification: Turn a parsed stack back into a string.
  • Stacktrace Conversion: Transform stack traces between different formats.
  • Structured CallSite Info: Directly work with static data gathered from V8 CallSite objects.
  • Source Map Integration: Map minified or transpiled stack frames back to their original source files and lines for accurate debugging.
  • Context Enrichment: Add valuable surrounding code context to each stack frame for deeper insights.
  • Error Serialization: Make error properties enumerable for easier serialization and logging.

And best of all, supports most stack trace formats you'll come across!

Stacklyn V2 will add even more cool stuff! See the roadmap to know more.

Supported Formats

  •   Chrome 3+ (V8)
  •   Node.js (V8)
  •   Electron (V8)
  •   Deno (V8)
  •   Firefox 1+ (SpiderMonkey)
  •   Safari 6+ (JSC)
  •   Bun (V8-JSC Hybrid)
  •   IE 10+ (ChakraCore)
  •   Edge Legacy (ChakraCore)
  •   Opera <15 (Linear B, Futhark, Carakan)
  •   Netscape 7+ (Mocha / SpiderMonkey)
  •   Espruino (not kidding)

Note

"Why do the logos look old?"

They show the first version that added stack trace support.
However, all versions after the ones marked with a + are supported too.

Import Stacklyn

Stacklyn supports all kinds of imports!

  1. As an HTML script tag:
    (note: Stacklyn is automatically placed as window.Stacklyn or globalThis.Stacklyn in the global scope if you do this)

    <script src="https://cdn.jsdelivr.net/npm/stacklyn/stacklyn.js"><script>
  2. For use in JavaScript code directly:

    // 1. ES Modules
    import Stacklyn from "stacklyn";
    
    // 2. CommonJS (Node only)
    const Stacklyn = require("stacklyn");
    
    // 3. RequireJS
    require(["stacklyn"], function(Stacklyn){
        // Your usage code here
    });
    
    // 4. Web Workers
    importScripts("https://cdn.jsdelivr.net/npm/stacklyn/stacklyn.js");
    
    // You can also refer to Stacklyn once imported as:
    Stacklyn; // Direct (works regardless of how you imported)
    window.Stacklyn; // Browsers
    globalThis.Stacklyn; // Modern JS runtimes (2020+)
    self.Stacklyn; // Web workers
    global.Stacklyn; // Node.js
    // And then use the methods as usual, for example: window.Stacklyn.parse(myError);

Note that with the way stacklyn is made, it works no matter what JS env you're running!

This means even in CSP'd environments (e.g. file://), you can still parse stack traces :D
(you cannot fetch local file information, best to use localhost for that)


Roadmap

  • Docs: In progress

V2 Roadmap

  • Extension System (Stacklyn.createExtension)
  • More Stack Formats (Jsish, Boa)
    • Graal.js, Hermes, JS-Interpreter, Duktape, XS, NJS, QuickJS, and LibJS will be added to parseV8 as an environment if statement.
  • Parse Bluebird extended stack traces
  • overwrite method to change the default runtime stack format, accepts a callback function

Contributing

We welcome contributors! If you've found a bug, had a suggestion, etc. Feel free to submit an issue or PR!

License

Stacklyn is licensed under the Apache-2.0 License, the full text is at LICENSE and a portion is located under every file.

About

Stacklyn is a zero-dependency, cross-engine, JavaScript stack trace parser.

stacklynjs.github.io/demo

Topics

error-handlingjavascriptparserstack-tracestacklynstacktracezero-dependency

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.