/copenhagenjs-deno

Deno not just runtime, Ivan Zvonimir Horvat

Primary LanguageTypeScript

Copenhagen JS

Deno not just runtime

Ivan Zvonimir Horvat

5th September 2024

Preview of upcoming Deno 2.0 features

Deno Runtime

Slides

Slides are done in ORG mode and best viewed with emacs tree slide extension

Run Examples

Prerequisites

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Add web assembly target
rustup target add wasm32-unknown-unknown

# Install Deno (will be single executable file)
curl -fsSL https://deno.land/install.sh | sh

Generate WASM portable binary

deno task wasmbuild

Example 1: CLI command

# Please run each command in separate shell
# First run Deno KV queue
deno task queue

# Second run Deno Cron
# - one cron job to show counter of succeeded and failed conversions
# - second cron job to delete converted files older than 3 minutes
deno task cron

# Run converter
deno task graying -h # Help command
deno task graying -f sample.webp

Example 2: Deno Fresh Example

# Serve wasm file on port 3000
deno task file-server

# Serve Fresh app on port 8000
deno task start

Notable commands

# Format
deno fmt

# Linter
deno lint

# Tests
deno test

# Benchmarks
deno bench

# Generate docs
deno doc

# Run task
deno task

# Information about module and cached directories
deno info