NAME

JavaScript::Duktape::XS - Perl XS binding for the Duktape Javascript embeddable engine

VERSION

Version 0.000040

SYNOPSIS

my $duk = JavaScript::Duktape::XS->new();

my %options = ( gather_stats => 1);
my $duk = JavaScript::Duktape::XS->new(\%options);

$duk->set('global_name', [1, 2, 3]);
$duk->set('my.object.slot', { foo => [ 4, 5 ] });
$duk->set('function_name', sub { my @args = @_; return \@args; });

my $aref = $duk->get('global_name');

my $returned = $duk->eval('function_name(my.object.slot)');

$duk->dispatch_function_in_event_loop('function_name');

my $stats = $duk->get_stats(); # returns a hashref

DESCRIPTION

This module provides an XS wrapper to call Duktape from Perl.

METHODS/ATTRIBUTES

new

set

get

eval

dispatch_function_in_event_loop

get_stats

SEE ALSO

https://metacpan.org/pod/JavaScript::Duktape

LICENSE

Copyright (C) Gonzalo Diethelm.

This library is free software; you can redistribute it and/or modify it under the terms of the MIT license.

AUTHOR

  • Gonzalo Diethelm gonzus AT cpan DOT org

THANKS