← All procedures

pnpm.exec

Run a program of the dependencies (node_modules/.bin) with pnpm exec

CLI
Package
@procedures/pnpm · README
Path
["pnpm","exec"]
CLI
mark pnpm exec --command <string>
As data
{"$proc":["pnpm","exec"],"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","exec"], { command: "<command>" });
console.log(JSON.stringify(result));

From the command line

$ mark pnpm exec --command <string>

As data, in a program

{ "$proc": ["pnpm", "exec"], "input": { "command": "<command>" } }

Input

FieldTypeRequiredDefaultDescription
commandstringyesThe program, for example tsc or eslint. pnpm finds it in node_modules/.bin
argsstring[]noThe arguments of the program. No shell reads them
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
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "command": {
        "type": "string",
        "description": "The program, for example tsc or eslint. pnpm finds it in node_modules/.bin"
      },
      "args": {
        "description": "The arguments of the program. No shell reads them",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "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": [
      "command"
    ]
  },
  "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"
      }
    },
    "required": [
      "exitCode",
      "stdout",
      "stderr",
      "success",
      "duration"
    ],
    "additionalProperties": {}
  }
}