https://github.com/akaiser/yaansi
Yet another ANSI implementation! A utility package to color your terminal.
https://github.com/akaiser/yaansi
ansi dart
Last synced: 4 months ago
JSON representation
Yet another ANSI implementation! A utility package to color your terminal.
- Host: GitHub
- URL: https://github.com/akaiser/yaansi
- Owner: akaiser
- License: bsd-3-clause
- Created: 2024-01-20T01:11:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-24T09:25:54.000Z (8 months ago)
- Last Synced: 2025-11-27T21:53:01.550Z (7 months ago)
- Topics: ansi, dart
- Language: Dart
- Homepage: https://pub.dev/packages/yaansi
- Size: 85 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# yaansi
Yet another ANSI implementation! A utility package to color your terminal.
Notable source: https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
## Usage
### Installation
```bash
dart pub add yaansi
```
### Example:
```dart
import 'package:yaansi/yaansi.dart';
void main() {
// extensions
print('Lorem ipsum'.bold.red);
// functions
print(blue(italic('Lorem ipsum')));
// inline mixing and nesting
print('${green(' Lorem').bold} ${redBg(' ipsum ').white}'.whiteBg);
// reusable styling
const style = YaansiStyle(
color: YaansiColor.yellow,
bgColor: YaansiColor.black,
modes: {YaansiMode.bold, YaansiMode.italic},
);
print(style.apply('One'));
print(style.apply('Two'));
}
```

## Notes
- Supports only basic colors and modes.
## License
See the [LICENSE](LICENSE) file.
## Version history
See the [CHANGELOG.md](CHANGELOG.md) file.