Skip to main content
QUICK REVIEW

[Paper Review] On the Impact of Micro-Packages: An Empirical Study of the npm JavaScript Ecosystem

Raula Gaikovina Kula, Ali Ouni|arXiv (Cornell University)|Sep 14, 2017
Open Source Software Innovations19 references17 citations
TL;DR

This paper investigates the impact of micro-packages in the npm JavaScript ecosystem through an empirical study of 169,964 packages. It finds that micro-packages are widespread, often have long dependency chains, and incur usage costs comparable to larger packages—challenging the assumption that they are lightweight and low-impact. The study highlights the fragility of ecosystems due to over-reliance on small, critical dependencies.

ABSTRACT

The npm repository contains JavaScript libraries that are used by millions of software developers. Its semantic versioning system relies on the ability to distinguish between breaking and non-breaking changes when libraries are updated. However, the dynamic nature of JavaScript often causes unintended breaking changes to be detected too late, which undermines the robustness of the applications. We present a novel technique, type regression testing, to automatically determine whether an update of a library implementation affects the types of its public interface, according to how the library is being used by other npm packages. By leveraging available test suites of clients, type regression testing uses a dynamic analysis to learn models of the library interface. Comparing the models before and after an update effectively amplifies the existing tests by revealing changes that may affect the clients. Experimental results on 12 widely used libraries show that the technique can identify type-related breaking changes with high accuracy. It fully automatically classifies at least 90% of the updates correctly as either major or as minor or patch, and it detects 26 breaking changes among the minor and patch updates.

Motivation & Objective

  • To understand the prevalence and distribution of micro-packages in the npm JavaScript ecosystem.
  • To analyze the complexity of dependency chains inherited by micro-packages.
  • To measure the developer usage costs (fetch, install, load times) associated with using micro-packages.
  • To assess whether micro-packages contribute to ecosystem fragility due to their sensitivity to dependency changes.
  • To motivate better awareness and resilience practices for third-party dependencies in software ecosystems.

Proposed method

  • Collected metadata and dependency graphs from 169,964 npm packages using npm registry data.
  • Defined micro-packages based on minimal functionality and single-responsibility design, using code size and function count as proxies.
  • Tracked transitive dependency chains using recursive dependency resolution from package.json files.
  • Measured usage costs via simulated fetch, install, and load time metrics using require-profiler and static code analysis.
  • Applied static code analysis with Esprima to extract code metrics such as function count and code complexity.
  • Conducted statistical analysis to compare micro-packages with non-micro-packages on dependency depth and usage cost.

Experimental results

Research questions

  • RQ1RQ1: How widespread are micro-packages across the npm ecosystem?
  • RQ2RQ2: What is the length and complexity of dependency chains inherited by micro-packages?
  • RQ3RQ3: What is the developer usage cost (fetch, install, load times) of using micro-packages compared to other npm packages?

Key findings

  • Micro-packages constitute a significant portion of the npm ecosystem, with many being widely reused despite their minimal functionality.
  • Some micro-packages exhibit long dependency chains—reaching as deep as 20+ levels—similar to larger, more complex packages.
  • Micro-packages incur usage costs (fetch, install, load times) that are statistically indistinguishable from those of non-micro-packages.
  • The study confirms that micro-packages are not inherently lightweight in terms of ecosystem impact, challenging the assumption of their low overhead.
  • The left-pad incident is validated as a canonical example of how a single micro-package can cause widespread ecosystem disruption.
  • The findings suggest that micro-packages contribute to ecosystem fragility due to their high dependency sensitivity and widespread reuse.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.