mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -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);
|