NPM.PackumentCache (NPM v0.7.1)

Copy Markdown View Source

Disk cache for npm registry packuments.

Registry packuments are fetched frequently during dependency resolution. Caching them under NPM.Cache.dir()/packuments reduces repeat network requests while keeping the cache short-lived enough to pick up newly published versions during normal development.

The TTL defaults to one hour and can be configured with config :npm, :packument_cache_ttl.

Summary

Functions

dir()

get(package)

@spec get(String.t()) :: {:ok, term()} | :miss

put(package, packument)

@spec put(String.t(), term()) :: :ok