Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xsawyerx/app-unansi
Remove ANSI coloring from output or files
https://github.com/xsawyerx/app-unansi
Last synced: 28 days ago
JSON representation
Remove ANSI coloring from output or files
- Host: GitHub
- URL: https://github.com/xsawyerx/app-unansi
- Owner: xsawyerx
- Created: 2016-12-18T10:40:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-19T15:24:05.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T11:37:13.980Z (about 1 month ago)
- Language: Perl
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
Awesome Lists containing this project
README
# NAME
App::UnANSI - Remove ANSI coloring from output or files
# VERSION
version 0.003
# SYNOPSIS
use App::UnANSI;
my $unansi = App::UnANSI->new();
my $some_line = get_line_with_coloring();
$unansi->remove_ansi_colors($some_line);
# $some_line is now clean# DESCRIPTION
This is the underlying implementation of
[unansi](https://metacpan.org/pod/distribution/App-UnANSI/bin/unansi).This is the documentation of the command implementation. You are most likely
looking for the command documentation itself:
[unansi](https://metacpan.org/pod/distribution/App-UnANSI/bin/unansi).# ATTRIBUTES
## files
Can be set on instantiation, returns a list of files to process.
my @files_to_process = $unansi->files;
# METHODS
## new
Creates a new instance. You can provide `files` to process.
my $unansi = App::UnANSI->new();
# or
my $unansi = App::UnANSI->new(
'files' => [ 'foo.txt', 'bar.txt' ],
);## new\_with\_options
Creates a new instance using options from the command line. This
is what the CLI uses.## run
Processes either the files or the input from the command line. In both cases
it prints to the screen. This might change for files in the future.## remove\_ansi\_colors
The actual code that removes the ANSI coloring from a string. It alters the
string it receives, for speed purposes.my $line = '...';
$unansi->remove_ansi_colors($line);# AUTHOR
Sawyer X
# COPYRIGHT AND LICENSE
This software is Copyright (c) 2016 by Sawyer X.
This is free software, licensed under:
The MIT (X11) License