17 Sep 2021 21:41:49 UTC
- Development release
- Distribution: Text-Minify-XS
- Module version: v0.4.9
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (0)
- KwaliteeBus factor: 1
- License: artistic_2
- Perl: v5.9.3
- Activity24 month
- Download (133.14KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- KNOWN ISSUES
- SEE ALSO
- COPYRIGHT AND LICENSE
Text::Minify::XS - Simple text minification
use Text::Minify::XS qw/ minify /; my $out = minify( $in );
None by default.
my $out = minify( $in );
This is a quick-and-dirty text minifier that removes whitespace in a single pass.
It does the following:
removes leading whitespace (indentation),
removes trailing whitespace,
removes multiple newlines,
and changes carriage returns to newlines.
It does not recognise any form of markup, comments or text quoting. Nor does it remove extra whitespace in the middle of the line.
This module requires Perl v5.9.3 or newer.
Pull requests to support older versions of Perl are welcome. See "SOURCE".
Malformed UTF-8 characters may be be mangled or omitted from the output. In extreme cases it may throw an exception in order to avoid memory overflows. You should ensure that the input string is properly encoded as UTF-8.
There are many string trimming and specialised whitespace/comment-removal modules on CPAN. Some of them are:
This list does not include specialised template filters or plugins to web frameworks.
Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/Text-Minify-XS/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Robert Rothenberg <email@example.com>
This software is Copyright (c) 2020-2021 by Robert Rothenberg.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Module Install Instructions
To install Text::Minify::XS, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Text::Minify::XS
For more information on module installation, please visit the detailed CPAN module installation guide.