Search⌘ K

Managing Dependencies and Lock Files

Explore how to manage dependencies effectively in Deno by creating a centralized deps.ts file and using lock files to guarantee consistent installation and resource integrity. Understand how these practices help maintain application stability and prevent conflicts as your project grows.

Dependency management

Previously, we learned how Deno enables us to do dependency management. In this lesson, we’ll use dependency management in a more practical context. We’ll start by removing all the scattered imports with URLs from our code and move them into a central dependency file. After this, we’ll create a lock file that makes sure our still young application runs smoothly anywhere it’s installed. We’ll finish by learning how can we install the project’s dependencies based on a lock file.

Creating a centralized dependency file

Previously, we were using direct URLs to dependencies directly in our code. Even though this is possible, this was something we discouraged a few chapters ago. Using direct URLs worked for us in the first phase, but as the application starts growing, we’ll have to manage our dependencies properly. We want to avoid struggles with conflicting dependency ...