Skip to content

Commit a7092a4

Browse files
Update third-party.md
1 parent e7cfa07 commit a7092a4

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

cheatsheets/javascript/deno/modules/third-party.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Example page:
2424
- [https://deno.land/x/](https://deno.land/x/denosaur)
2525

2626

27-
## Oak
27+
## Web server
2828

29-
From the [deno.land/x/oak/](https://deno.land/x/oak/#oak) module.
29+
Demo of using the [deno.land/x/oak/](https://deno.land/x/oak/#oak) module.
3030

3131
The `Application` class wraps the `serve()` function from the `http` package.
3232

@@ -35,7 +35,7 @@ Middleware is added with the `.use()` method.
3535
A Hello World server:
3636

3737
- `index.ts`
38-
```javascript
38+
```typesript
3939
import { Application } from "https://deno.land/x/oak/mod.ts";
4040
4141
const app = new Application();
@@ -56,3 +56,29 @@ $ deno run --allow-net index.ts
5656
View in the browswer:
5757

5858
- http://localhost:8000
59+
60+
61+
## Colors
62+
63+
Demo of using the [deno.land/x/color](https://deno.land/x/color#color) module.
64+
65+
- `index.ts` - using TypeScript
66+
```typescript
67+
import clc from 'https://deno.land/x/color/index.ts'
68+
69+
console.log(clc.red.text("I am red"))
70+
71+
console.log(clc.bgYellow.text("I am bgYellow"))
72+
73+
console.log(clc.reset.text("I am reset"))
74+
console.log(clc.bright.text("I am bright"))
75+
```
76+
- `index.js` - JavaScript alternative.
77+
```javascript
78+
import clc from 'https://deno.land/x/color/index.js
79+
80+
console.log(clc.red.text("I am red"))
81+
82+
// ...
83+
```
84+

0 commit comments

Comments
 (0)