Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graze/console-diff-renderer
Only write minimal changes to the console
https://github.com/graze/console-diff-renderer
console-tool php symfony-console
Last synced: about 2 months ago
JSON representation
Only write minimal changes to the console
- Host: GitHub
- URL: https://github.com/graze/console-diff-renderer
- Owner: graze
- License: mit
- Created: 2017-06-07T13:37:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-01T07:55:06.000Z (over 2 years ago)
- Last Synced: 2024-10-26T13:46:05.702Z (2 months ago)
- Topics: console-tool, php, symfony-console
- Language: PHP
- Size: 71.3 KB
- Stars: 5
- Watchers: 12
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Console Diff Renderer
[![Latest Version on Packagist](https://img.shields.io/packagist/v/graze/console-diff-renderer.svg?style=flat-square)](https://packagist.org/packages/graze/console-diff-renderer)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/graze/console-diff-renderer/master.svg?style=flat-square)](https://travis-ci.org/graze/console-diff-renderer)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/graze/console-diff-renderer.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/console-diff-renderer/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/graze/console-diff-renderer.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/console-diff-renderer)
[![Total Downloads](https://img.shields.io/packagist/dt/graze/console-diff-renderer.svg?style=flat-square)](https://packagist.org/packages/graze/console-diff-renderer)Only render things that have changed to the console.
[![asciicast](https://asciinema.org/a/9233umuuyo8gi0gifmnudjz26.png)](https://asciinema.org/a/9233umuuyo8gi0gifmnudjz26)
## Usage
```php
$output = new DiffConsoleOutput($existing);$output->reWrite([
'first line',
'second line',
]);$output->reWrite([
'first line here',
'second line',
]);
```This will navigate the cursor to the end of `first line` and write ` here` then navigate the cursor back to the end.
- Supports Formatting
- Supports ANSI control codes
- Will wrap around based on the terminal size
- Can trim based on the terminal size
- Will only write the number of lines that are visible to the user## Install
Via Composer
``` bash
$ composer require graze/console-diff-renderer
```## Development
```bash
$ make build
```### Testing
```bash
$ make test
```### Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Harry Bragg](https://github.com/h-bragg)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.