Build a SvelteKit App with Deno 2

Introduction

Welcome to this tutorial on building a SvelteKit app with Deno 2. In this guide, we will walk you through the process of setting up a new SvelteKit project using Deno, and explore some of the key features and benefits of using this powerful combination.

Start by verifying that you have the latest version of Deno installed, you will need at least Deno 2.1.10 (The tutorial is run with 2.2.11:

deno --version

Create a SvelteKit app with Deno

The Svelte team provides a CLI tool to quickly scaffold a new SvelteKit app. In your terminal run the following command to create a new SvelteKit app with Deno:

deno run -A npm:sv create dinosaurs

When prompted, select the default options to create a new SvelteKit app with TypeScript and the demo option.

Then, cd into the newly created project folder and run the following command to serve your new SvelteKit app:

deno task dev --open

This will start the SvelteKit server and the --open option opens your browser automatically.