Overview of nostics
mainnostics is a library designed for library authors to replace ad hoc error strings with structured, actionable error reporting. It allows you to use stable error codes (e.g., NUXT_B2011), provide actionable fixes, link to documentation, and include source locations within a Diagnostic object.
Key capabilities include:
- Stable codes: Permanent identifiers for known problems that remain constant even if the wording changes.
- Actionable fixes: Integrated instructions on how to resolve the error.
- Typed params: Using functions to ensure dynamic error messages and fixes are type-safe via TypeScript.
- Reporters: Support for logging to the console, appending NDJSON to files, POSTing to endpoints, or implementing custom reporters.
- Production stripping: A build plugin to remove report-only diagnostics and their catalog text from production bundles.
- Vite dev collection: Ability to forward browser diagnostics to a local log file during Vite development.