Remove trailing newlines and carriage returns from stdin.
Using cargo:
cargo install nlnUsing cargo-binstall (faster, no compilation):
cargo binstall nlnUsing mise (global):
mise use -g cargo:nlnOr download binaries from releases.
# Remove trailing newlines
echo -e "hello\n\n" | nln
# Use with files
cat file.txt | nln
# Copy to clipboard without trailing newlines
cat script.sh | nln | pbcopyThe tool preserves newlines within content, only removing trailing ones.
MIT