Skip to content

Commit

Permalink
shrink bundle size by 20kb by only importing a single tar function
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed Dec 13, 2024
1 parent 972e7a5 commit 9cb777d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import path from "node:path";
import process from "node:process";
import { Readable } from "node:stream";
import { finished } from "node:stream/promises";
import * as tar from "tar";
import { extract } from "tar/extract";

/**
* Get the latest version of Scorecard from GitHub.
Expand Down Expand Up @@ -130,7 +130,7 @@ async function verifyChecksum(downloadUrl: string): Promise<void> {
async function extractTarGz(filePath: string): Promise<string> {
const dest = path.join(os.tmpdir(), "scorecard");
fs.mkdirSync(dest, { recursive: true });
await tar.x({
await extract({
file: filePath,
cwd: dest,
gzip: true,
Expand Down

0 comments on commit 9cb777d

Please sign in to comment.