An Annual Dependency Audit for Your Package

Automated tools keep dependencies up to date week by week, but they never ask whether a dependency should be there at all. Once a year, pick a quiet week and look at every direct dependency of your package with fresh eyes. It usually takes an afternoon for a small library and repays itself in smaller installs, fewer advisories and less churn for your users.

Why once a year

Dependencies accumulate. One was added for a single helper function that the language now provides natively; another was pulled in for a feature you later removed; a third was healthy when you chose it and has since gone quiet. None of these show up as failures, so weekly maintenance never touches them. A fixed annual date, for example the first weeks of the new year after a holiday freeze, turns it into a habit rather than a project.

The questions for each direct dependency

  1. Is it still used? Search the source for imports. Tools such as depcheck for JavaScript or deptry for Python can flag unused declarations.
  2. Is it in the right section? Build and test tools belong in development dependencies; a framework your users already have may belong in peer dependencies rather than dependencies.
  3. Could the runtime replace it? Many once-common helpers now have standard-library equivalents.
  4. Is it maintained? Look at recent releases, open security advisories and whether issues get responses. An OpenSSF Scorecard result can be a useful summary, as one input among several.
  5. What does it cost? Check its own transitive dependencies and install scripts. A small direct dependency can bring a large tree.
  6. Is the licence still compatible? Licences occasionally change between major versions; confirm the SPDX identifier of the version you resolve.
  7. Is the version range sensible? Too loose and you accept breaking majors; too tight and you force duplicate copies on your users.

A worksheet to record decisions

DependencyUsed forSectionLicenceHealthDecision
Package A (illustrative)Argument parsingruntimeMITActiveKeep
Package B (illustrative)One string helperruntimeISCInactiveReplace with built-in
Package C (illustrative)Test fixturesruntime (wrong)MITActiveMove to dev

Keep the worksheet in the repository, for example as docs/dependency-audit.md, so next year's audit starts from this year's reasoning rather than from scratch.

Shipping the results

Removing or moving a dependency is usually invisible to users, so a minor or patch release is fine. Changing a dependency to a peer dependency, or raising a peer range, can break installs and deserves careful thought about versioning; our peer dependencies explainer covers that. Note every change in the changelog under a "Dependencies" heading, and mention any reduction in install size you measured.