# codsen-format-diagnostic-value

> Safely format untrusted JavaScript values for diagnostics

Latest version **1.1.1** (published 2026-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install codsen-format-diagnostic-value
pnpm add codsen-format-diagnostic-value
yarn add codsen-format-diagnostic-value
bun add codsen-format-diagnostic-value
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2026-09-06 |
| First published | 2026-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18.20.8 |
| Dependencies | 0 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 214 |
| Author | Roy Revelt |
| Maintainers | royston |
| Keywords | diagnostic, error, format, safe, serialize, value |

## Links

- npm: https://www.npmjs.com/package/codsen-format-diagnostic-value
- Repository: https://github.com/codsen/codsen
- Homepage: https://codsen.com/os/codsen-format-diagnostic-value
- Issues: https://github.com/codsen/codsen/issues
- npm.io page: https://npm.io/package/codsen-format-diagnostic-value

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2026-09-06
- 1.1.0 — 2026-09-01
- 0.0.1 — 2026-08-28

## README

<h1 align="center">codsen-format-diagnostic-value</h1>

<p align="center">Safely format untrusted JavaScript values for diagnostics</p>

<p align="center">
  <a href="https://codsen.com/os/codsen-format-diagnostic-value" rel="nofollow noreferrer noopener">
    <img src="https://img.shields.io/badge/-codsen-blue?style=flat-square" alt="page on codsen.com">
  </a>
  <a href="https://www.npmjs.com/package/codsen-format-diagnostic-value" rel="nofollow noreferrer noopener">
    <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
  </a>
  <a href="https://github.com/codsen/codsen/tree/main/packages/codsen-format-diagnostic-value" rel="nofollow noreferrer noopener">
    <img src="https://img.shields.io/badge/-github-blue?style=flat-square" alt="page on github">
  </a>
  <a href="https://npmcharts.com/compare/codsen-format-diagnostic-value?interval=30" rel="nofollow noreferrer noopener" target="_blank">
    <img src="https://img.shields.io/npm/dm/codsen-format-diagnostic-value.svg?style=flat-square" alt="Downloads per month">
  </a>
  <a href="https://codsen.com/os/codsen-format-diagnostic-value/changelog" rel="nofollow noreferrer noopener">
    <img src="https://img.shields.io/badge/changelog-here-brightgreen?style=flat-square" alt="changelog">
  </a>
  <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
</p>

**No dependencies whatsoever.** This package declares no dependencies or devDependencies.

## Install

This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).

```bash
npm i codsen-format-diagnostic-value
```

## Quick Take

```js
import { strict as assert } from "node:assert";

import { formatDiagnosticValue } from "codsen-format-diagnostic-value";

assert.equal(
  formatDiagnosticValue({ input: Symbol("marker") }),
  '{"input":Symbol("marker")}',
);
```


## Documentation

Please [visit codsen.com](https://codsen.com/os/codsen-format-diagnostic-value/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/codsen-format-diagnostic-value/CHANGELOG.md) or [the website](https://codsen.com/os/codsen-format-diagnostic-value/changelog).

## Contributing

To report bugs or request features or assistance, [raise an issue](https://github.com/codsen/codsen/issues/new/choose) on GitHub.

## Licence

MIT License

Copyright © 2010-2026 Roy Revelt and other contributors

<p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>

---
_Source: https://npm.io/package/codsen-format-diagnostic-value · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
