← All procedures
npm.whoami
Give the user name of the npm registry
CLI- Package
- @procedures/npm · README
- Path
["npm","whoami"]- CLI
mark npm whoami- As data
{"$proc":["npm","whoami"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/npm/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["npm","whoami"], {});
console.log(JSON.stringify(result));From the command line
$ mark npm whoami
As data, in a program
{ "$proc": ["npm", "whoami"], "input": {} }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"registry": {
"description": "The URL of the registry (default: the registry of the npm configuration)",
"type": "string"
},
"cwd": {
"description": "Working directory",
"type": "string"
},
"timeout": {
"description": "Timeout in milliseconds",
"type": "number"
}
}
},
"output": {
"type": "object",
"properties": {
"exitCode": {
"type": "number",
"description": "The exit code of npm (0 is success)"
},
"stdout": {
"type": "string",
"description": "The standard output of npm"
},
"stderr": {
"type": "string",
"description": "The standard error of npm, or the error message when npm 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"
},
"username": {
"description": "The user name, when npm has a login for the registry",
"type": "string"
}
},
"required": [
"exitCode",
"stdout",
"stderr",
"success",
"duration"
],
"additionalProperties": {}
}
}