Skip to content

Commit 10ecf82

Browse files
committed
ported the colors example
1 parent 2f5614f commit 10ecf82

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

examples/colors.res

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// see https://deno.land/std/examples/colors.ts
2+
3+
@scope("import.meta") @val
4+
external main: bool = "main"
5+
6+
if main {
7+
open RescriptDeno.Std.Fmt.Color
8+
9+
"Hello world!"->bold->red->italic->bgBlue->Js.log
10+
}

src/RescriptDeno_Std_Fmt_Color.res

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ external setEnabled: bool => unit = "setColorEnabled"
1010
@module("https://deno.land/std/fmt/colors.ts")
1111
external getEnabled: unit => bool = "getColorEnabled"
1212

13+
@module("https://deno.land/std/fmt/colors.ts")
14+
external bold: string => string = "bold"
15+
1316
@module("https://deno.land/std/fmt/colors.ts")
1417
external reset: string => string = "reset"
1518

0 commit comments

Comments
 (0)