Thanks to visit codestin.com
Credit goes to lib.rs

#white-space #strip #cli

app trailing-whitespaces

Removes trailing whitespaces and trailing empty lines from text files

17 releases (4 breaking)

0.5.0 Sep 17, 2025
0.5.0-beta.1 Sep 3, 2025
0.4.0 May 27, 2025
0.3.0 May 22, 2025
0.1.0 May 21, 2025

#1385 in Filesystem

Codestin Search App

721 downloads per month

Unlicense OR CC0-1.0

12KB
148 lines

trailing-whitespaces

Crates.io Version Unlicense MSRV 1.59 Dependency status Safe Rust Lines of code Crates.io Downloads

Removes trailing whitespaces and trailing empty lines from text files.

Inspired by JavaScript npx tool https://github.com/o175/trailing-whitespaces#readme for removing trailing whitespace from lines in text files.

Usage

trailing-whitespaces [-v] glob ...

-v lists changed files

Difference from original tool

JavaScript version of trailing-whitespaces do not remove trailing empty lines like we do.

Glob patterns

Rust glob crate patterns are described here. They are slighly different from JavaScript fast-glob patterns which original JavaScript trailing-whitespaces tool uses.

Instead of

npx trailing-whitespaces ./src/**/.js

You need to run

trailing-whitespaces ./src/**/*.js

License

This is free and unencumbered software released into the public domain.

This code can be used under terms of CC0-1.0 or the Unlicense.

Unlicense logo

Dependencies

~175KB