How to use the @pnpm/package-requester.getCacheByEngine function in @pnpm/package-requester

To help you get started, we’ve selected a few @pnpm/package-requester examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / packages / package-store / src / storeController / index.ts View on Github external
async function getPackageLocation (
    packageId: string,
    packageName: string,
    opts: {
      lockfileDir: string,
      targetEngine?: string,
    }
  ) {
    if (opts.targetEngine) {
      const sideEffectsCacheLocation = (await getCacheByEngine(initOpts.storeDir, packageId))[opts.targetEngine]
      if (sideEffectsCacheLocation) {
        return {
          dir: sideEffectsCacheLocation,
          isBuilt: true,
        }
      }
    }

    return {
      dir: path.join(initOpts.storeDir, pkgIdToFilename(packageId, opts.lockfileDir), 'node_modules', packageName),
      isBuilt: false,
    }
  }

@pnpm/package-requester

Concurrent downloader of npm-compatible packages

MIT
Latest version published 8 days ago

Package Health Score

63 / 100
Full package analysis

Popular @pnpm/package-requester functions