Back to Explore

unjs/destr

GitHub
1 watchersOpen source

Last release: 4/3/2025

destr is a Node.js, Deno, and JavaScript utility that provides a faster, safer alternative to JSON.parse for arbitrary inputs. It supports safeDestr for strict parsing, returns the original value when parsing fails, and includes protections intended to help avoid prototype pollution.

Project status

  • Actively maintained, evidence includes multiple tagged updates (v2.0.3 in 2024-02-20, v2.0.4 and v2.0.5 in 2025-04-03) and an upstream GitHub push as recently as 2026-06-05.
  • Update cadence appears bursty rather than steady, with a long gap between v2.0.3 and v2.0.4, then two follow-up updates on the same day (v2.0.4, v2.0.5).

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v2.0.5

    4/3/2025

    v2.0.5 makes a build tooling change only. It downgrades the unbuild dependency to address a CJS type regression, with the concrete version change reflected in package.json and pnpm-lock.yaml.

  • v2.0.4

    4/3/2025

    v2.0.4 focuses on performance improvements to `destr` string parsing, including faster handling of plain strings and known literal values. It also adds a `sideEffects: false` package.json flag. The code diff additionally includes several dev tooling and CI changes that are not mentioned in the release notes.

  • v2.0.3

    2/20/2024

    v2.0.3 focuses on fixing compatibility with runtimes that do not implement String.prototype.at(). The main behavior change is in the string handling fast-path, with additional repo hygiene updates (bench tooling, CI, and dependency churn).

  • v2.0.2

    10/24/2023

    v2.0.2 focuses on fixing how destr recognizes and parses numeric-like strings (decimals and scientific notation), and it hardens the “fast path” behavior for quoted strings that may contain escape characters. The code changes are primarily in the input-shape detection logic in src/index.ts, plus added unit tests for escaped strings and a broader set of numeric cases.

  • v2.0.1

    8/2/2023

    v2.0.1 is a small patch release focused on performance and documentation/testing updates. The main code change avoids unnecessary lowercasing for long input strings, while tests and dev tooling (and lockfile) are updated accordingly.

  • v2.0.0

    6/12/2023

    v2.0.0 makes Destr typesafe by default and introduces stricter, safer behaviors via new APIs. The main migration impact is an export change, where you must switch to the named `destr` export, plus potential TypeScript typing differences due to updated generic defaults.

    BreakingFeatures