← All procedures

pnpm.why

Show the packages that depend on a package: data is the JSON of pnpm why --json

CLI
Package
@procedures/pnpm · README
Path
["pnpm","why"]
CLI
mark pnpm why --packages <string[]>
As data
{"$proc":["pnpm","why"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/pnpm/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["pnpm","why"], { packages: [] });
console.log(JSON.stringify(result));

From the command line

$ mark pnpm why --packages <string[]>

As data, in a program

{ "$proc": ["pnpm", "why"], "input": { "packages": [] } }

Input

FieldTypeRequiredDefaultDescription
packagesstring[]yesThe packages (names or patterns)
depthintegernoThe depth of the dependency tree
prodbooleannoOnly the dependencies, not the dev dependencies (--prod)
devbooleannoOnly the dev dependencies (--dev)
filterstring[]noRun in the workspace packages that these pnpm selectors match, for example @scope/app or ./packages/** (--filter)
recursivebooleannoRun in each package of the workspace (--recursive)
cwdstringnoWorking directory
timeoutnumbernoTimeout in milliseconds

Output

FieldTypeRequiredDefaultDescription
exitCodenumberyesThe exit code of pnpm (0 is success)
stdoutstringyesThe standard output of pnpm
stderrstringyesThe standard error of pnpm, or the error message when pnpm did not start
successbooleanyesTrue when the exit code is 0
durationnumberyesThe time of the command, in milliseconds
dataanynoThe parsed JSON of the standard output, when it is JSON
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "packages": {
        "minItems": 1,
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The packages (names or patterns)"
      },
      "depth": {
        "description": "The depth of the dependency tree",
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "prod": {
        "description": "Only the dependencies, not the dev dependencies (--prod)",
        "type": "boolean"
      },
      "dev": {
        "description": "Only the dev dependencies (--dev)",
        "type": "boolean"
      },
      "filter": {
        "description": "Run in the workspace packages that these pnpm selectors match, for example @scope/app or ./packages/** (--filter)",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "recursive": {
        "description": "Run in each package of the workspace (--recursive)",
        "type": "boolean"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      },
      "timeout": {
        "description": "Timeout in milliseconds",
        "type": "number"
      }
    },
    "required": [
      "packages"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "exitCode": {
        "type": "number",
        "description": "The exit code of pnpm (0 is success)"
      },
      "stdout": {
        "type": "string",
        "description": "The standard output of pnpm"
      },
      "stderr": {
        "type": "string",
        "description": "The standard error of pnpm, or the error message when pnpm did not start"
      },
      "success": {
        "type": "boolean",
        "description": "True when the exit code is 0"
      },
      "duration": {
        "type": "number",
        "description": "The time of the command, in milliseconds"
      },
      "data": {
        "description": "The parsed JSON of the standard output, when it is JSON"
      }
    },
    "required": [
      "exitCode",
      "stdout",
      "stderr",
      "success",
      "duration"
    ],
    "additionalProperties": {}
  }
}