https://github.com/thebespokepixel/truwrap-cli
CLI wrapper for truwrap
https://github.com/thebespokepixel/truwrap-cli
Last synced: about 2 months ago
JSON representation
CLI wrapper for truwrap
- Host: GitHub
- URL: https://github.com/thebespokepixel/truwrap-cli
- Owner: thebespokepixel
- License: mit
- Created: 2021-11-04T14:27:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-10T21:47:59.000Z (7 months ago)
- Last Synced: 2024-11-10T22:32:29.636Z (7 months ago)
- Language: JavaScript
- Size: 11.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# truwrap-cli
> A CLI wrapper for [`truwrap`][1]##### Publishing Status
[](https://www.npmjs.com/package/truwrap-cli "npm") [](https://libraries.io/github/thebespokepixel/truwrap-cli "Libraries.io")
[](https://travis-ci.com/thebespokepixel/truwrap-cli "Travis") [](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")##### Development Status
[](https://travis-ci.com/thebespokepixel/truwrap-cli "Travis") [](https://libraries.io/github/thebespokepixel/truwrap-cli "Libraries.io")
[](https://snyk.io/test/github/thebespokepixel/truwrap-cli "Snyk") [](https://codeclimate.com/github/thebespokepixel/truwrap-cli/maintainability "Code-Climate") [](https://codeclimate.com/github/thebespokepixel/truwrap-cli/test_coverage "Code-Climate Coverage")##### Documentation/Help
[](https://twitter.com/thebespokepixel "Twitter")
A simple wrapper that enables CLI usage of `truwrap` - great for formatting text output in scripts.
![Screengrab][grab]
## Usage
#### Installation
```shell
npm install --save @thebespokepixel/truwrap
```#### CLI
```text
truwrap
Smarter terminal text wrapping (handles 24bit color)Synopsis:
cat inputFile | truwrap [options]Options:
-h, --help Display this help.
-v, --version Return the current version on stdout. -vv Return name & version.
-V, --verbose Be verbose. -VV Be loquacious.
-o, --stderr Use stderr rather than stdout
-l, --left Left margin
-r, --right Right margin
-w, --width Set total width. Overrides terminal window’s width.
-t, --truncate Truncate panel cells.
-m, --mode Wrapping mode
-s, --stamp Print arguments rather than stdin. printf-style options supported.
-p, --panel Render a tabular panel into the available console width.
-d, --delimiter The column delimiter when reading data for a panel.
-x, --regex Character run selection regex.
--color Force color depth --color=256|16m. Disable with --no-colorUsage:
Reads unformatted text from stdin and typographically applies paragraph wrapping it for the currently active tty.
```To use, simply pipe in a body of text to wrap according to the supplied options.
```shell
cat readme.md | truwrap --left 6 --right 6 --mode soft
```### Related
For advanced 24bit colour handling see [thebespokepixel/trucolor](https://github.com/thebespokepixel/trucolor) and [npm trucolor](https://www.npmjs.com/package/trucolor).
## Documentation
Documentation for `truwrap` can be found at [https://thebespokepixel.github.io/truwrap/][1][1]: https://github.com/thebespokepixel/truwrap
[grab]: https://raw.githubusercontent.com/thebespokepixel/truwrap-cli/develop/media/truwrap.png