How to use @pnpm/headless - 1 common examples

To help you get started, we’ve selected a few @pnpm/headless 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 / supi / src / install / index.ts View on Github external
ctx.existsWantedLockfile &&
        ctx.wantedLockfile.lockfileVersion === LOCKFILE_VERSION &&
        await pEvery(ctx.importers, async (importer) =>
          !hasLocalTarballDepsInRoot(ctx.wantedLockfile, importer.id) &&
          satisfiesPackageManifest(ctx.wantedLockfile, importer.manifest, importer.id) &&
          linkedPackagesAreUpToDate(importer.manifest, ctx.wantedLockfile.importers[importer.id], importer.rootDir, opts.workspacePackages)
        )
      )
    ) {
      if (!ctx.existsWantedLockfile) {
        if (ctx.importers.some((importer) => pkgHasDependencies(importer.manifest))) {
          throw new Error(`Headless installation requires a ${WANTED_LOCKFILE} file`)
        }
      } else {
        logger.info({ message: 'Lockfile is up-to-date, resolution step is skipped', prefix: opts.lockfileDir })
        await headless({
          currentEngine: {
            nodeVersion: opts.nodeVersion,
            pnpmVersion: opts.packageManager.name === 'pnpm' ? opts.packageManager.version : '',
          },
          currentLockfile: ctx.currentLockfile,
          engineStrict: opts.engineStrict,
          extraBinPaths: opts.extraBinPaths,
          force: opts.force,
          hoistedAliases: ctx.hoistedAliases,
          hoistPattern: ctx.hoistPattern,
          ignoreScripts: opts.ignoreScripts,
          importers: ctx.importers as Array<{
            binsDir: string,
            buildIndex: number,
            id: string,
            manifest: ImporterManifest,

@pnpm/headless

Fast installation using only pnpm-lock.yaml

MIT
Latest version published 6 days ago

Package Health Score

66 / 100
Full package analysis

Popular @pnpm/headless functions