Back to Explore

sindresorhus/clean-stack

GitHub
1 watchersOpen source

Last release:

Clean up error stack traces by removing mostly unhelpful internal Node.js entries, making stack output easier to read. It can also run in the browser and Electron, and includes options to prettify file paths, remove a base path, and filter stack lines.

Project status

  • Maintenance status: The repo appears actively maintained, with a recent updates activity in 2025, including a major update (v6.0.0 on 2025-11-04), though there has been no new update since then as of 2026-08-12.
  • Update cadence: The pattern looks irregular, with a short gap between v5.3.0 (2025-09-15) and v6.0.0 (2025-11-04), but a much longer gap before that (v5.2.0 in 2023-03-21).

AI summary generated

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

Recent updates

  • v6.0.0

    v6.0.0 raises the minimum supported Node.js version to 20, and includes fixes for browser compatibility and stack idempotency. The runtime implementation also underwent a refactor around path normalization and how the home directory is derived.

    Breaking
  • v5.3.0

    clean-stack v5.3.0 updates the `pretty` option to additionally handle `file://` stack trace paths by converting them to regular filesystem paths. The release notes call out the `file://` conversion explicitly, and the tests and docs were updated accordingly.

    Features
  • v5.2.0

    v5.2.0 introduces a new `pathFilter` option to `cleanStack`, allowing callers to further filter which stack lines are kept or removed based on a callback. The implementation applies the callback in addition to the existing built-in filtering of internal Node and known unwanted paths. Release notes only mention the option addition, and the code, types, README, and tests reflect that change.

    Features
  • v5.1.0

    v5.1.0 changes how the user home directory is determined, making the lookup lazy and only computing it when `cleanStack` is called with `pretty: true`. The release notes only mention this optimization, with no other behavior changes documented.

  • v5.0.1

    v5.0.1 is a targeted patch release focused on correcting how `cleanStack` replaces the `basePath` portion of stack traces when the stack uses newer async formats. The code change adjusts the internal regular expression and replacement behavior, and a new test case was added to cover `at async ...` frames.

  • v5.0.0

    clean-stack v5.0.0 updates runtime/browser behavior and tightens the supported Node.js range. The release notes highlight Node.js 14 as a breaking requirement and improvements to browser compatibility plus expanded `basePath` handling (file URLs and trailing slashes).

    BreakingFeatures
  • v4.2.0

    Release v4.2.0 updates clean-stack to remove Electron-related stack frames that appear in error traces on Windows. The only code change is in the stack filtering logic, expanding the set of Electron bundle path patterns that are excluded.

  • v4.1.0

    v4.1.0 updates clean-stack to support being called with an undefined stack value. The TypeScript types, README, and runtime behavior were adjusted so the function returns undefined instead of operating on a non-string input.

    Features
  • v4.0.1

    v4.0.1 is a small patch release focused on improving how clean-stack recognizes and cleans stack trace frames that use the `node:` protocol prefix. The change updates the internal stack line matching regex and adds test coverage for `node:events` and `node:fs/promises` stack frames.

  • v4.0.0

    v4.0.0 is a major release that modernizes the package for Node.js >= 12 and switches the module format to pure ESM. The implementation and TypeScript types were updated to support default ESM imports instead of CommonJS require/exports.

    Breaking