NAME
Data::Dump::JavaScript - Pretty printing of data structures as JavaScript
VERSION
version 0.002
SYNOPSIS
my
$javascript
= dump_javascript({
foo
=> [1, 2],
bar
=>
'hello!'
,
baz
=> true });
DESCRIPTION
Data::Dump::JavaScript is a fork of JSON::Tiny version 0.55 which outputs pretty-printed JavaScript.
The indention is according to JavaScript Standard Style and JavaScript Semi-Standard Style. Hash keys are sorted in standard string comparison order.
FUNCTIONS
Data::Dump::JavaScript implements the following functions, which can be imported individually.
false
my
$false
= false;
False value, used because Perl has no equivalent.
true
my
$true
= true;
True value, used because Perl has no native equivalent.
dump_javascript
my
$bytes
= dump_javascript({
foo
=>
'bar'
});
Encode Perl value to UTF-8 encoded JavaScript.
SEE ALSO
- Data::JavaScript
-
Can only dump Perl structures as JavaScript variable assignment. No boolean handling, no formatting.
- Data::JavaScript::Anon
-
No boolean handling, no formatting.
AUTHOR
Alexander Hartmaier <abraxxa@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by Alexander Hartmaier.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.