DEV Community

Cover image for Getting Started with Svelte JS
Naya Willis
Naya Willis

Posted on

Getting Started with Svelte JS

So I've been skimming through some Svelte documentation recently and from what I've been reading it seems to be earning my heart. The ease of use and implementation is all a developer can ask for. This short blog will mostly be about starting and setting up a Svelte application. For this I'll be using VSCode.

What is Svelte?

"Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.

Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes."

  • The website

Step 1:

Open VSCode and create the necessary folder where you will be housing your project.

Step 2:

Go into your terminal and cd into that folder that you created.

Step 3:

Run the command

> npx degit sveltejs/template app-name

This will auto generate some files and folders for you. Similar to how React would.

Step 4:

After you run that command it will generate a folder with your app name. Cd into that folder then run

> npm install

This will install all of the necessary dependencies. You should see a package-lock.json appear in your directory.

Alt Text

Step 5:

Lastly, run the command...

> npm run dev

This will start a server running on PORT 5000 (http://localhost:5000). Happy coding!

======================================================

Part 2: Building a Booklist Application using Svelte

Discussion (0)