JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q20348F
  • License MIT

Trims trailing spaces after each line and trims leading and trailing newlines in a file

Package Exports

  • text-tailor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (text-tailor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

A command line tool for removing extra whitespaces and newlines in a file. Given a file, this tool deletes trailing whitespaces on every line as well as deletes leading and trailing newlines. The original file is overwritten by the trimmed content. If a directory is specified, files in the directory will be evaluated. If the recursive flag -r is set, files in nested subdirectories will also be evaluated.

Installation

npm install text-tailor -g

Example Uses

For a single file:

text-tailor ./path/to/file.txt

For multiple files:

text-tailor ./path/to/file1.txt ./path/to/file2.txt ... ./path/to/fileN.txt

For a single directory, non-recursively:

text-tailor ./path/to/dir

For a single directory, recursively:

text-tailor ./path/to/dir -r

For multiple files and directories, recursively:

text-tailor ./path/to/file1 ./path/to/dir1 ... ./path/to/fileN ./path/to/dirN -r