#!perl # ABSTRACT: Generate JavaScript from exported Perl constants # PODNAME: js-const use strict; use warnings; use Path::Tiny qw/ path /; use JavaScript::Const::Exporter; our $VERSION = 'v0.1.7'; my $exporter = JavaScript::Const::Exporter->new_with_options; my $buffer = $exporter->process; if (my $output = shift @ARGV) { my $file = path($output); $file->spew_raw($buffer); } else { print $buffer; } __END__ =pod =encoding UTF-8 =head1 NAME js-const - Generate JavaScript from exported Perl constants =head1 VERSION version v0.1.7 =head1 SYNOPSIS js-const -Ilib -m MyApp::Consts public/js/consts.js =head1 DESCRIPTION This is a command-line interface for L. =head1 OPTIONS =head2 C<-c> I, C<--constants> I This specifies a constant or export tag to extract. Can be specified multiple times. If omitted, it will attempt to use the module's C<@EXPORT_OK>. =head2 C<-I> I, C<--include> I Option paths to include in C<@INC>. =head2 C<-m> I, C<--mpdile> I The module name to extract constants from. =head2 C<-p>, C<--pretty> Enable pretty printed JSON for arrays or objects (hashes). =head2 C<-u>, C<--use_var> Use var instead of const. =head1 SEE ALSO L L =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS Please report any bugs or feature requests on the bugtracker website L 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. =head1 AUTHOR Robert Rothenberg =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2020-2022 by Robert Rothenberg. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut