element-source: a JavaScript library that resolves the source file location, component name, and full stack trace for any DOM element at runtime.
Key features:
- Works with React, Preact, Vue, Svelte, and Solid
- Async API with
resolveElementInfo,resolveSource,resolveStack, andresolveComponentName - Custom framework resolver support via
createSourceResolver - Built-in stack formatting with
formatStackandformatStackFrame - Originally built to power React Grab, a browser tool for feeding source context to AI coding agents
๐ Blog Post
๐ GitHub Repo
๐ Live Demo
Top comments (0)