MCPcopy Create free account
hub / github.com/Snapchat/Valdi / decompressTo

Function decompressTo

npm_modules/cli/src/utils/zipUtils.ts:5–14  ·  view source on GitHub ↗
(inputFilePath: string, outputFilePath: string)

Source from the content-addressed store, hash-verified

3import path from 'node:path';
4import { promisify } from 'node:util';
5
6const execFileAsync = promisify(execFile);
7
8export async function decompressTo(inputFilePath: string, outputFilePath: string): Promise<void> {
9 const archive = path.resolve(inputFilePath);
10 const destination = path.resolve(outputFilePath);
11
12 try {
13 // `extract-zip` stalls or exits early with Node 26, which is the pinned
14 // runtime used by mise. `unzip` works on the supported macOS/Linux hosts.
15 // Avoid restoring stale reproducible-archive timestamps so temporary
16 // directory cleaners do not delete assets from a live web session.
17 await execFileAsync('unzip', ['-DD', '-q', '-o', archive, '-d', destination]);

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected