UNPKG

lil-http

Version:

Tiny, lightweight, full featured HTTP client

32 lines (27 loc) 641 B
<html> <head> <meta charset="utf-8"> </head> <body> <script src="../thread.js"></script> <script> var worker = thread() worker.run(function (done) { setTimeout(function () { done('invalid') }, 10) }).catch(function (err) { console.log('Error:', err) }) worker.on('message', function (msg) { console.log('Message:', msg) }) worker.on('error', function (err) { console.log('Error:', err) }) // future API worker.on('start', function () {}) worker.on('end', function () {}) </script> </body> </html>