@kszongic/join-lines-cli
v1.0.0
Published
Join lines from stdin with a custom delimiter
Maintainers
Readme
join-lines-cli
Join lines from stdin with a custom delimiter. Zero dependencies.
Install
npm i -g @kszongic/join-lines-cliUsage
# Join with comma (default)
echo -e "a\nb\nc" | join-lines
# a,b,c
# Custom delimiter
echo -e "a\nb\nc" | join-lines -d " | "
# a | b | c
# Join with space
ls | join-lines -s
# file1 file2 file3
# Trim whitespace from each line
echo -e " a \n b " | join-lines --trim -d -
# a-bOptions
| Flag | Description |
|------|-------------|
| -d, --delimiter <str> | Delimiter string (default: ,) |
| -s, --space | Join with a space |
| -n, --newline | Join with newline |
| -0, --null | Join with null byte |
| --trim | Trim each line before joining |
| -h, --help | Show help |
| -v, --version | Show version |
License
MIT © kszongic
