npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

elm-dep-cache

v1.0.2

Published

Cache Elm dependencies to avoid CI/CD connection timeouts

Readme

elm-dep-cache

A Node.js tool to cache Elm dependencies and avoid CI/CD connection timeouts.

Problem

CI/CD pipelines sometimes experience connection timeouts when fetching Elm dependencies from package.elm-lang.org. This tool solves that by caching dependencies locally based on your elm.json checksum.

Installation

Global Installation

npm install -g elm-dep-cache

Use with npx (no installation required)

npx elm-dep-cache

Use in CI/CD

Add to your CI/CD pipeline before running Elm commands:

npx elm-dep-cache

How It Works

  1. Calculates checksum of your elm.json file
  2. Checks for cache: Looks for .elm-dep-cache/{checksum}/
  3. Restores from cache if found: Copies cached dependencies to $ELM_HOME
  4. Falls back to installation if no cache: Runs Elm to fetch dependencies, then caches them

Usage

Simply run in your Elm project directory (where elm.json exists):

npx elm-dep-cache

The tool will:

  • Print what it's doing at each step
  • Use cached dependencies when available (fast!)
  • Fetch and cache dependencies when needed (slow first time, fast afterwards)

Cleaning Old Caches

To remove all cached entries that don't match your current elm.json:

npx elm-dep-cache --clean

This is useful when:

  • You've changed your elm.json multiple times and want to clean up old caches
  • You want to free up disk space by removing unused dependency caches
  • Your cache directory has accumulated many old versions

Cache Location

Dependencies are cached in ./.elm-dep-cache/{checksum}/ relative to your project directory.

You can commit this directory to version control, or add it to your CI cache configuration.

Environment Variables

  • ELM_HOME: If set, uses this as the Elm home directory. Otherwise uses the default location:
    • macOS/Linux: ~/.elm
    • Windows: %APPDATA%/elm

Example Output

Normal Run

[elm-dep-cache] Starting elm-dep-cache
[elm-dep-cache] elm.json checksum: a3f2c8b1...
[elm-dep-cache] ELM_HOME: /Users/username/.elm
[elm-dep-cache] Cache directory: ./.elm-dep-cache/a3f2c8b1...
[elm-dep-cache] Cache found!
[elm-dep-cache] Restoring Elm dependencies from cache: ./.elm-dep-cache/a3f2c8b1...
[elm-dep-cache] ✓ Successfully restored dependencies from cache
[elm-dep-cache] ✓ Done! Dependencies restored from cache.

Clean Run

[elm-dep-cache] Starting elm-dep-cache
[elm-dep-cache] elm.json checksum: a3f2c8b1...
[elm-dep-cache] Cleaning old cache entries...
[elm-dep-cache]   Removing old cache: b4e7d9a2...
[elm-dep-cache]   Removing old cache: c8f1e3b5...
[elm-dep-cache]   Keeping current cache: a3f2c8b1...
[elm-dep-cache] ✓ Cleaned 2 old cache entries
[elm-dep-cache] ✓ Kept 1 current cache entry
[elm-dep-cache] ✓ Done!

CI/CD Integration Examples

GitHub Actions

- name: Cache Elm dependencies
  run: npx elm-dep-cache

- name: Build Elm
  run: elm make src/Main.elm --output=main.js

GitLab CI

build:
  script:
    - npx elm-dep-cache
    - elm make src/Main.elm --output=main.js

CircleCI

- run:
    name: Cache Elm dependencies
    command: npx elm-dep-cache

- run:
    name: Build Elm
    command: elm make src/Main.elm --output=main.js

Caching Strategies

Option 1: Commit Cache to Git

Commit the cache directly to your repository:

git add .elm-dep-cache
git commit -m "Add Elm dependencies cache"

Pros: Cache is immediately available on CI without extra configuration. Cons: Increases repository size.

Option 2: Use CI Cache

Add to .gitignore:

.elm-dep-cache/

Then configure your CI to cache the .elm-dep-cache directory between builds:

GitHub Actions:

- name: Cache Elm dep-cache
  uses: actions/cache@v4
  with:
    path: .elm-dep-cache
    key: elm-dep-cache-${{ hashFiles('elm.json') }}

- name: Install Elm dependencies
  run: npx elm-dep-cache

GitLab CI:

cache:
  paths:
    - .elm-dep-cache/
  key:
    files:
      - elm.json

CircleCI:

- restore_cache:
    keys:
      - elm-dep-cache-{{ checksum "elm.json" }}

- run: npx elm-dep-cache

- save_cache:
    key: elm-dep-cache-{{ checksum "elm.json" }}
    paths:
      - .elm-dep-cache

Pros: Keeps repository small. Cons: Requires CI cache configuration.

License

MIT