Reference

Examples

Every language feature has a runnable example under examples/ — no README snippets to go stale, just .ts files that compile and run, verified on every build. All 198 of them are here, grouped by area; pick one from the tree on the left.

Arrays 10

assert 1

Async / Promise 9

Basics 20

BigInt 1

Blob 1

Buffer 1

child_process 1

Classes 1

Closures 2

cluster 1

console 1

Control flow 2

Web Crypto 1

Date 1

dgram 1

dns 2

Dynamic 1

Encoding / Text 1

Enums 1

EventEmitter 2

Events 4

EventSource 1

fetch 6

File system 1

fs (async) 1

fs (streams) 1

Function expressions 2

Generators 2

Generics 3

Globals 3

HTTP server 5

HTTP/2 1

Modules 17

util.inspect 1

Interfaces 1

JSON 2

Language 1

Literal expressions 1

Map 1

Math 1

Memory management 2

Nested functions 1

net 2

Nullable scalars 1

Nullish 1

Objects 4

os 1

path 1

Process / CLI 4

Process stdin 1

querystring 1

readline 1

RegExp 4

Set 1

Streams 7

Strings 9

Structured Clone 1

Tagged Templates 1

Testing 1

Timers 1

tls 2

Try Catch 2

Tuples 1

Typedarrays 1

Types 14

URL 2

util 1

Weak 1

WebSocket 2

Workers 10

zlib 1