UNPKG

lil-http

Version:

Tiny, lightweight, full featured HTTP client

27 lines (23 loc) 465 B
<html> <head> <meta charset="utf-8"> </head> <body> <script src="../thread.js"></script> <script> var worker = thread({ env: { error: true } }) var task = worker.run(function (done) { setTimeout(function () { if (env.error) { done('invalid') } }, 50) }) task.catch(function (err) { console.log('Error:', err) }) </script> </body> </html>