dedent is an ES6 string tag (and also usable as a function) that strips indentation from multi-line strings, making template strings easier to read and keeping unintended spaces out of the output. It also supports options like trimming leading and trailing whitespace, aligning multi-line interpolated values (alignValues), and controlling whether special characters are escaped.
Project status
- Actively maintained: The upstream repo shows a recent push on 2026-03-01, and updates 1.7.1 and 1.7.2 landed within seconds on that date, indicating ongoing maintenance rather than a dormant state.
- Update cadence: After 1.7.0 (2025-09-03), there were follow-up updates (1.7.1 and 1.7.2 on 2026-03-01). That is roughly a 6-month gap between feature and subsequent refinement, with tight patch releases when changes are made.
AI summary generated
Recent updates
v1.7.2
v1.7.2 fixes handling of escape sequences when using the dedent tagged-template API. The code change expands unescaping behavior beyond just `\n`, converting multiple escape forms into their actual character equivalents when `escapeSpecialCharacters` is enabled.
v1.7.1
v1.7.1 primarily adds a Bun-specific workaround to preserve Unicode characters when running the dedent tagged template. The code also expands test coverage for emojis and ideographs, and introduces optional Bun-based test execution for contributors. Release notes only mention the Bun Unicode workaround, but the diff shows additional, undocumented tooling and configuration changes.
v1.7.0
This release adds a new `alignValues` option to the `dedent` tagged template helper, along with supporting tests and TypeScript typings. When enabled, multi-line interpolated strings are re-indented so their subsequent lines visually align with the interpolation’s starting column. The release notes also mention a README badge cleanup.
Featuresv1.6.0
v1.6.0 adds a new `trimWhitespace` option to the `dedent` template tag. The implementation changes when the library trims leading and trailing whitespace, and it updates tests and the README accordingly.
Featuresv1.5.3
v1.5.3 makes a small change to the package metadata in package.json. It removes the Node engine constraint and the npm provenance publish configuration.
Breakingv1.5.2
v1.5.2 is primarily a tooling and maintenance release, with documented updates to the build/lint setup, pnpm onboarding, and README/doc tweaks. It also includes a small functional fix related to how escaped newlines and special characters are handled when `escapeSpecialCharacters` is configured.
Breakingv1.5.1
v1.5.1 is a small packaging fix focused on TypeScript ESM type definition distribution. The release notes claim it adds a missing `dedent.d.mts` entry to `package.json` so downstream TypeScript users can resolve the correct ESM types.
v1.5.0
v1.5.0 introduces a new `escapeSpecialCharacters` option and a `dedent.withOptions()` API to control how special characters are treated when using the library. Release notes only mention this option, but the implementation changes where escaping is applied, affecting how `dedent` behaves when called as a normal function versus as a string tag.
Featuresv1.4.0
Release v1.4.0 is described as two small fixes: adding a missing ESM type definition file and consuming the first level of escaping for `$` and `{` characters. The code diff, however, shows broader packaging and build system changes (TypeScript conversion, new package.json exports/types wiring, and changes to how babel-plugin-macros is provided).
v1.0.1
Release v1.0.1 is described as a version bump only to mark the 1.x line as stable. The code diff shows no functional code changes, only an update to the package version in package.json.