mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 00:29:09 -05:00
18 lines
346 B
TypeScript
18 lines
346 B
TypeScript
|
import chalk from "npm:chalk";
|
||
|
|
||
|
console.log(chalk.red("Hello world!"));
|
||
|
|
||
|
globalThis.addEventListener("unhandledrejection", (e) => {
|
||
|
console.log("Handled the promise rejection");
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
// deno-lint-ignore require-await
|
||
|
(async () => {
|
||
|
throw new Error("boom!");
|
||
|
})();
|
||
|
|
||
|
setTimeout(() => {
|
||
|
console.log("Success");
|
||
|
}, 1000);
|