docs/versioned_docs/version-0.17.2/ci/quickstart/simplify.mdx
import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem";
At this point, you have successfully built a pipeline for an application using the Dagger API. This is important knowledge to have, so that you understand the basics of using Dagger and can begin creating pipelines for your own applications.
That said, Dagger also lets you use Dagger Functions developed by others and published to the Daggerverse, Dagger's free and publicly-available index of Dagger modules.
:::tip THE DAGGERVERSE Dagger's superpower is its community. All around the world, Daggernauts are encoding their expertise into Dagger Functions, and sharing them for anyone to reuse. The Daggerverse is a free service run by Dagger, which indexes all publicly available Dagger modules, and lets you easily search and consume them. Using the Daggerverse, you can easily discover great modules being developed by the community, learn how they work, and start using them. Since modules are just source code, it's easy to contribute to them, too!
Using the Daggerverse is optional, and does not change how you use Dagger. If you find a module you like, simply copy its URL, and use it the usual way. :::
To understand how this works in practice, let's simplify the pipeline using the Node module from the Daggerverse. This module contains tested, ready-to-use Dagger Functions for building, linting and testing Node.js applications.
Install the Node module as a dependency by running the dagger install command shown on its Daggerverse page:
dagger install github.com/dagger/dagger/sdk/typescript/dev/node@3f3fc28e5a2d139dfe5088278a363a5db7acb356
:::tip VERSION PINNING
The exact Git commit for the module version is recorded in dagger.json. Dagger enforces version pinning, which guarantees that the module version you install is the one you'll be using.
:::
Once you've installed the Node module, start exploring it to see what you can do with it. There are various ways to do this:
dagger -m node functions or dagger -m node call --help.Next, update the pipeline to use this module.
<Tabs groupId="language"> <TabItem value="Go">Update the dagger/main.go file with the following code:
Update the dagger/src/hello_dagger/main.py file with the following code:
This code listing revises the Dagger Functions from earlier, replacing calls to the core Dagger API with calls to Dagger Functions from the Node module. This allows you to access pre-defined functionality for working with Node.js applications - for example, obtaining a base image with npm and cache volumes already configured, or executing common commands to lint, format, test, and build a Node.js codebase.
If you backtrack a little further and inspect the Node module's source code, you'll notice two important things:
dag client and many of the core Dagger API methods you used when building your own Dagger Functions.Run the pipeline:
<Tabs groupId="shell"> <TabItem value="System shell"> ```shell dagger -c publish ``` </TabItem> <TabItem value="Dagger Shell"> ```shell title="First type 'dagger' for interactive mode." publish ``` </TabItem> </Tabs>As before, you should see the application being tested, built, and published to the ttl.sh container registry. Everything works exactly as before, even though the pipeline is now using a Daggerverse module.
:::tip PRIVATE CONTAINER REGISTRIES This quickstart uses the public ttl.sh container registry, but Dagger also supports publishing to private registries, including Docker Hub, GitHub Container Registry, and many others. :::
Using a Daggerverse module instead of writing your own Dagger Functions is often advantageous because:
:::tip UNLOCKING CROSS-LANGUAGE COLLABORATION Dagger Functions can call other functions, across languages. So, even though the Node module in this section is written in TypeScript, you can transparently call its functions from another Dagger module written in Go, Python or any other supported language. This means that you no longer need to care which language your CI tooling is written in; you can use the one that you're most comfortable with or that best suits your requirements.
Dagger is able to do this because it uses GraphQL as its low-level language-agnostic API query language. Each Dagger SDK generates native code-bindings for all dependencies, which abstract away the underlying GraphQL queries. This gives you all the benefits of type-checking, code completion and other IDE features when developing Dagger Functions. :::