@parcel/codeframe
Blazing fast, zero configuration web application bundler
This package has a good security score with no known vulnerabilities.
Community Reviews
Focused utility for error display - minimal overhead, does one thing well
In production, it's been rock-solid. The API is dead simple: pass in your source code, location info, and get back a nicely formatted string. No configuration needed, no state to manage, no connections to pool. Memory footprint is negligible since it just does string manipulation. Performance is excellent - formatting happens in microseconds even for large files.
The main gotcha is that it's a presentation layer tool, not a bundler itself. If you're looking for Parcel the bundler, that's a different package. This shines in CLI tools, build plugins, or any tooling where you need to display user-friendly error messages with code context. Error handling is straightforward - if you pass invalid input, it fails fast with clear messages.
Best for: CLI tools, linters, compilers, or build systems that need to display source code errors with context to users.
Avoid if: You need actual bundling functionality or more advanced AST manipulation beyond error display formatting.
Solid utility for displaying syntax-highlighted error frames
The TypeScript definitions are clean and the main function signature is intuitive. You get terminal color support out of the box with proper ANSI codes. Error messages are minimal since the library itself is quite simple—it either works or you've passed invalid input. The main gotcha is understanding that this is a low-level primitive; you need to handle source maps and position mapping yourself if working with transformed code.
Documentation is sparse but the package is simple enough that reading the TypeScript definitions tells you everything you need. It does one thing well without unnecessary abstractions. Perfect for building developer tools, CLI error reporters, or custom bundler/transpiler output.
Best for: Building developer tools, CLI applications, or custom build tools that need to display helpful code error contexts.
Avoid if: You need a complete error handling solution with source map resolution or want higher-level abstractions.
Solid utility for error formatting with minimal overhead
The API is straightforward: pass in your code string, line/column numbers, and optional highlighting. Performance is excellent even with large source files - it only processes the relevant lines plus context. Error handling is minimal since the function is simple, though it doesn't gracefully handle edge cases like invalid line numbers (returns empty string). No logging hooks or observability built in, which is fine for a utility this focused.
Configuration is barebones - you get what you get in terms of formatting style. No timeout concerns since it's sync. Breaking changes between Parcel versions can affect this package, but the API surface is small enough that impact is usually minimal. Works reliably under load in CLI tools and build systems where we've used it for error reporting.
Best for: Build tools, CLI applications, and development servers needing formatted error output with code context.
Avoid if: You need extensive customization of error formatting or require async/streaming interfaces for very large files.
Sign in to write a review
Sign In