Chapter 8: Using External Libraries
Reducing duplication by sharing code is a rule of thumb in many programming languages. Doing this within the context of a single project is easy enough. However, when you want to share something between multiple projects, it becomes a bit more challenging. Fortunately for us, most languages also provide their own package managers that allow us to install other libraries in our projects as dependencies in order to make use of the code defined therein.
Most commonly, these external projects are just called libraries or packages, but a few languages have unique names for them, such as Ruby gems. Crystal follows the Ruby pattern and names its projects Crystal Shards. In this chapter, we are going to explore the world of external libraries, including how to find, install, update, and manage them. We will cover the following topics:
- Using Crystal Shards
- Finding Shards