pipr.tools

trim-lines

Trim whitespace from each line

Aa Text

Try it

stdin0 chars
stdout0 chars

Example

Trim whitespace from indented lines

Usage
$ echo "  hello  
    world  
  foo  " | trim-lines
View source
(input) =>
      input
        .split("\n")
        .map((l) => l.trim())
        .join("\n")

Suggested Pipelines

Related Tools