Back to Explore

sindresorhus/strip-indent

GitHub
1 watchersOpen source

Last release: 2025-10-12

strip-indent is a JavaScript utility for removing redundant indentation by stripping leading whitespace from each line in a string. It determines how much to remove based on the line with the least leading whitespace (ignoring empty lines), and it also offers a dedent function that removes surrounding blank lines.

Project status

  • This GitHub source appears actively maintained, with updates as recently as 2025-10-12 (about 8 months ago relative to 2026-06-11) and a follow-up update shortly before (2025-09-11).
  • Update cadence looks bursty but currently active: v4.1.0 and v4.1.1 came within about a month of each other in late 2025, following a much longer gap since v4.0.0 in 2021.

AI summary generated 2026-06-11

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

Recent updates

  • v4.1.1

    2025-10-12

    Release v4.1.1 makes a small API surface adjustment related to the module default export. The only code diff change affecting developers is in the TypeScript declaration file, plus a package version bump.

    Breaking
  • v4.1.0

    2025-09-11

    v4.1.0 introduces a new named export, `dedent`, intended for cleaning up template literals by stripping indentation and removing surrounding whitespace-only blank lines. The codebase also changes the underlying implementation of `stripIndent`, updates documentation and tests, and modifies the repo tooling/dependencies.

    Features
  • v4.0.0

    2021-05-03

    v4.0.0 is a major release focused on moving the package to pure ESM and raising the supported Node.js version. The implementation and TypeScript typings were updated to use a default export, and package metadata was adjusted accordingly.

    Breaking
  • v3.0.0

    2019-04-17

    v3.0.0 introduces a TypeScript definition and raises the minimum supported Node.js version. The release includes a breaking change requiring Node.js 8, so existing users on older Node versions will need to upgrade their runtime.

    BreakingFeatures