JavaScript::QuickJS::Promise(3pm)

JavaScript::QuickJS::Promise3pm

Javascript `promise` in perl

Usage

    my $js = JavaScript::QuickJS->new();
    $js->eval("Promise.resolve(123)")->then( sub { CORE::say "resolved: @_" } );
    CORE::say "before await";
    $js->await();
    CORE::say "after await";

Overview

This class represents a JavaScript Promise <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise> instance in Perl.

This class is not instantiated directly.

Methods

This exposes then(), catch(), and finally() methods that wrap the JavaScript methods of the same names.

From libjavascript-quickjs-perl 0.21-2+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.