jsstacktrace

package module
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

jsstacktrace

jsstacktrace converts stack traces generated inside the browser using locally available map files

This makes it easy to convert log data containing stack traces of minimized/packaged JS to the contain the correct line number and source file information on your server.

Usage

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"

	"github.com/teamconclude/jsstacktrace"
)

func main() {
	if len(os.Args) != 2 {
		fmt.Println("Usage: simple <baseDir>")
		os.Exit(1)
	}
	jsMap := jsstacktrace.NewJSMap(os.Args[1])

	reader := bufio.NewReader(os.Stdin)
	data, err := io.ReadAll(reader)
	if err != nil {
		panic(err)
	}

	mappedStack := jsMap.ConvertStackTraceString(string(data))

	fmt.Print(mappedStack)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSMap

type JSMap struct {
	// contains filtered or unexported fields
}

func NewJSMap

func NewJSMap(baseDir string) *JSMap

func (*JSMap) ConvertFrame

func (m *JSMap) ConvertFrame(stackFrame StackFrame) StackFrame

func (*JSMap) ConvertStackTrace

func (m *JSMap) ConvertStackTrace(stackTrace StackTrace) StackTrace

func (*JSMap) ConvertStackTraceString

func (m *JSMap) ConvertStackTraceString(stackTrace string) string

type StackFrame

type StackFrame struct {
	Url      string
	Line     int
	Column   int
	Function string
	Other    string // used when the line is not a valid stack frame
}

func StackFrameFromString

func StackFrameFromString(s string) *StackFrame

func (*StackFrame) String

func (sf *StackFrame) String() string

type StackTrace

type StackTrace []StackFrame

func ParseStackTrace

func ParseStackTrace(s string) StackTrace

func (StackTrace) String

func (s StackTrace) String() string

Directories

Path Synopsis
examples
simple command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL