Download and extract npm package tarballs.
Verifies SHA-512 integrity and extracts contents to disk.
Summary
Functions
Extract a .tgz tarball into a destination directory.
Download a tarball, verify its integrity, and extract to a directory.
Verify SHA-512 integrity of a binary against an SRI hash.
Functions
@spec extract(binary(), String.t()) :: {:ok, non_neg_integer()} | {:error, term()}
Extract a .tgz tarball into a destination directory.
Strips the package/ prefix that npm tarballs use.
Returns {:ok, file_count}.
@spec fetch_and_extract(String.t(), String.t(), String.t()) :: {:ok, non_neg_integer()} | {:error, term()}
Download a tarball, verify its integrity, and extract to a directory.
Returns {:ok, file_count} or {:error, reason}.
Verify SHA-512 integrity of a binary against an SRI hash.