Skip to content

Commit

Permalink
feat: support npm_config_registry env variable (#2743)
Browse files Browse the repository at this point in the history
  • Loading branch information
byomess committed Dec 14, 2022
1 parent 6ecf729 commit df7ce2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/deno/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ async function installFromNPM(name: string, subpath: string): Promise<string> {
} catch (e) {
}

const url = `https://registry.npmjs.org/${name}/-/${name.replace('@esbuild/', '')}-${version}.tgz`
const npmRegistry = Deno.env.get("NPM_CONFIG_REGISTRY") || "https://registry.npmjs.org";
const url = `${npmRegistry}/${name}/-/${name.replace("@esbuild/", "")}-${version}.tgz`;
const buffer = await fetch(url).then(r => r.arrayBuffer())
const executable = extractFileFromTarGzip(new Uint8Array(buffer), subpath)

Expand Down

0 comments on commit df7ce2a

Please sign in to comment.