{
  "_id": "@vscode/sudo-prompt",
  "maintainers": [
    {
      "email": "kamaet@microsoft.com",
      "name": "kaimaetzel"
    },
    {
      "email": "lszomoru@microsoft.com",
      "name": "lszomoru"
    },
    {
      "email": "alexdima@microsoft.com",
      "name": "alexandrudima"
    },
    {
      "email": "steven.m.batten@outlook.com",
      "name": "sbatten"
    },
    {
      "email": "npmjs@microsoft.com",
      "name": "microsoft1es"
    },
    {
      "email": "vscode-bot-npm@microsoft.com",
      "name": "vscode-bot"
    }
  ],
  "keywords": [
    "sudo",
    "os",
    "dialog",
    "prompt",
    "command",
    "exec",
    "user access control",
    "UAC",
    "privileges",
    "administrative",
    "elevate",
    "run as administrator"
  ],
  "dist-tags": {
    "latest": "9.3.2"
  },
  "author": {
    "name": "Joran Dirk Greef"
  },
  "_rev": "18-afc38c0de146ba6f1e778482bd1f6b1a",
  "description": "Run a command using sudo, prompting the user with an OS dialog if necessary",
  "readme": "# sudo-prompt\n\nRun a non-graphical terminal command using `sudo`, prompting the user with a graphical OS dialog if necessary. Useful for background Node.js applications or native Electron apps that need `sudo`.\n\n**Note:** the origin of this work is at https://github.com/jorangreef/sudo-prompt and has been moved to https://github.com/microsoft/vscode-sudo-prompt for maintenance and use in VS Code as that original repository is archived by now.\n\n## Cross-Platform\n`sudo-prompt` provides a native OS dialog prompt on **macOS**, **Linux** and **Windows**.\n\n![macOS](https://raw.githubusercontent.com/jorangreef/sudo-prompt/master/macos.png)\n\n![Linux](https://raw.githubusercontent.com/jorangreef/sudo-prompt/master/linux.png)\n\n![Windows](https://raw.githubusercontent.com/jorangreef/sudo-prompt/master/windows.png)\n\n## Installation\n`sudo-prompt` has no external dependencies and does not require any native bindings.\n```\nnpm install sudo-prompt\n```\n\n## Usage\nNote: Your command should not start with the `sudo` prefix.\n```javascript\nvar sudo = require('@vscode/sudo-prompt');\nvar options = {\n  name: 'Electron',\n  icns: '/Applications/Electron.app/Contents/Resources/Electron.icns', // (optional)\n};\nsudo.exec('echo hello', options,\n  function(error, stdout, stderr) {\n    if (error) throw error;\n    console.log('stdout: ' + stdout);\n  }\n);\n```\n\n`sudo-prompt` will use `process.title` as `options.name` if `options.name` is not provided. `options.name` must be alphanumeric only (spaces are supported) and at most 70 characters.\n\n`sudo-prompt` will preserve the current working directory on all platforms. Environment variables can be set explicitly using `options.env`.\n\n**`sudo-prompt.exec()` is different to `child-process.exec()` in that no child process is returned (due to platform and permissions constraints).**\n\n## Behavior\nOn macOS, `sudo-prompt` should behave just like the `sudo` command in the shell. If your command does not work with the `sudo` command in the shell (perhaps because it uses `>` redirection to a restricted file), then it may not work with `sudo-prompt`. However, it is still possible to use sudo-prompt to get a privileged shell, [see this closed issue for more information](https://github.com/jorangreef/sudo-prompt/issues/1).\n\nOn Linux, `sudo-prompt` will use either `pkexec` or `kdesudo` to show the password prompt and run your command. Where possible, `sudo-prompt` will try and get these to mimic `sudo`. Depending on which binary is used, and due to the limitations of some binaries, the name of your program or the command itself may be displayed to your user. `sudo-prompt` will not use `gksudo` since `gksudo` does not support concurrent prompts. Passing `options.icns` is currently not supported by `sudo-prompt` on Linux. Patches are welcome to add support for icons based on `polkit`.\n\nOn Windows, `sudo-prompt` will elevate your command using User Account Control (UAC). Passing `options.name` or `options.icns` is currently not supported by `sudo-prompt` on Windows.\n\n## Non-graphical terminal commands only\nJust as you should never use `sudo` to launch any graphical applications, you should never use `sudo-prompt` to launch any graphical applications. Doing so could cause files in your home directory to become owned by root. `sudo-prompt` is explicitly designed to launch non-graphical terminal commands. For more information, [read this post](http://www.psychocats.net/ubuntu/graphicalsudo).\n\n## Concurrency\nOn systems where the user has opted to have `tty-tickets` enabled (most systems), each call to `exec()` will result in a separate password prompt. Where `tty-tickets` are disabled, subsequent calls to `exec()` will still require a password prompt, even where the user's `sudo` timestamp file remains valid, due to edge cases with `sudo` itself, [see this discussion for more information](https://github.com/jorangreef/sudo-prompt/pull/76).\n\nYou should never rely on `sudo-prompt` to execute your calls in order. If you need to enforce ordering of calls, then you should explicitly order your calls in your application. Where your commands are short-lived, you should always queue your calls to `exec()` to make sure your user is not overloaded with password prompts.\n\n## Invalidating the timestamp\nOn macOS and Linux, you can invalidate the user's `sudo` timestamp file to force the prompt to appear by running the following command in your terminal:\n\n```sh\n$ sudo -k\n```\n",
  "repository": {
    "url": "git+https://github.com/microsoft/vscode-sudo-prompt.git",
    "type": "git"
  },
  "bugs": {
    "url": "https://github.com/microsoft/vscode-sudo-prompt/issues"
  },
  "license": "MIT",
  "versions": {
    "9.3.0": {
      "name": "@vscode/sudo-prompt",
      "version": "9.3.0",
      "keywords": [
        "sudo",
        "os",
        "dialog",
        "prompt",
        "command",
        "exec",
        "user access control",
        "UAC",
        "privileges",
        "administrative",
        "elevate",
        "run as administrator"
      ],
      "author": {
        "name": "Joran Dirk Greef"
      },
      "license": "MIT",
      "_id": "@vscode/sudo-prompt@9.3.0",
      "maintainers": [
        {
          "name": "hticehurst",
          "email": "v-hticehurst@microsoft.com"
        },
        {
          "name": "rchiodo",
          "email": "rchiodo@microsoft.com"
        },
        {
          "name": "rebornix",
          "email": "penn.lv@gmail.com"
        },
        {
          "name": "bpasero",
          "email": "benjpas@microsoft.com"
        },
        {
          "name": "raymondzhao",
          "email": "raymondzhao@microsoft.com"
        },
        {
          "name": "mistople",
          "email": "ddossett@microsoft.com"
        },
        {
          "name": "kaimaetzel",
          "email": "kamaet@microsoft.com"
        },
        {
          "name": "connor.peet",
          "email": "connor@peet.io"
        },
        {
          "name": "roblourens",
          "email": "roblourens@gmail.com"
        },
        {
          "name": "chrmarti",
          "email": "chrmarti@microsoft.com"
        },
        {
          "name": "tyriar",
          "email": "tyriar@tyriar.com"
        },
        {
          "name": "jrieken",
          "email": "jrieken@microsoft.com"
        },
        {
          "name": "alexandrudima",
          "email": "alexdima@microsoft.com"
        },
        {
          "name": "tylerl0706",
          "email": "me@tylerleonhardt.com"
        },
        {
          "name": "miguelsolorio",
          "email": "miguel.solorio@microsoft.com"
        },
        {
          "name": "deepak_robo",
          "email": "hop2deep@gmail.com"
        },
        {
          "name": "aeschli",
          "email": "martinae@microsoft.com"
        }
      ],
      "homepage": "https://github.com/microsoft/vscode-sudo-prompt#readme",
      "bugs": {
        "url": "https://github.com/microsoft/vscode-sudo-prompt/issues"
      },
      "dist": {
        "shasum": "5c63b195986d1d6a142856146e51c6b46a3319b2",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@vscode/sudo-prompt/-/sudo-prompt-9.3.0.tgz",
        "fileCount": 8,
        "integrity": "sha512-/c/A4/fEBhKXiEW2+Cv8qid6uWA6Igg9iaHrlMoNyoHynziYLYFCaF8lGcmvQ20wEi5l7xyx4YxG2h5nVKazeg==",
        "signatures": [
          {
            "sig": "MEQCIHrGIn/LLP17OwYpWRRTGWFCGAvbFLBFgXI0C4xVRqCcAiBP4F7x9sTnbNDHMw/P+65izDe/aawPdXh59nSl0pxQEQ==",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ],
        "unpackedSize": 47357,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlO19CRA9TVsSAnZWagAAEzcP/RJK6chpjDOO7AbO4MXB\nvPItePP+PirYc6ZRmtxJpvOOWb+N9XYTuyYd4g33jR/0CKa0CsxhgPmhUfjL\n7dh863KdfVFLwF2QxkT3S/vnBUXXPpsMJvP4895f3hJ0ql3tTZ64eRJN90/0\nuC83Rw3se/jzfw8qzbT1aKVUKyJDa47ePaa8w5DhCps7asCMBYKzlPwGG+Sb\n2N5hG0sfwVSrlF2Kkk+9TA242I52scOduGmhzybGT8kfSnVkR9TR1HgO61Fg\now++10v1vymwc2IV/DTi67IOQ0/q2/ZJFKHYiSnifB1TKhqXV7/2KoC2rmrv\npNyk1SnTSUatw7GhXyT0hBjSJiv/KUlkyaRBND2GeDSWpI3GTllN9ToXfIm6\nILCzlkXLNgyvxeC7Q7EhEgDXd53CDxfO2EMZTa2b+pl9Qdx/lIVN/g45FrZj\n+mkPuN2cEzKGE+ML8s416sUhXKVNuJg7r0ykJMKI3PWb3rUNux+J9MqXiNDC\nlVcqTo1S7LgUxVYl2vZg01b5iZB6TLPuwAm9Eeg4eETNkWT6k5lFFF5OkFKH\nRR21p+uZglf1hNdxpNeSkzguBy3uZUxb7g1LJbscdr2StU+hcRysDRWmZc6G\n2X6h+AQkN20hbp1aPsHB6Cc8VCZd+F/6GlhXKNszeGGhHHphuq2UYGjD9Pxb\nPt5g\r\n=u2En\r\n-----END PGP SIGNATURE-----\r\n"
      },
      "main": "index.js",
      "types": "index.d.ts",
      "gitHead": "212514f131c27b3ee90e1ffe731a62e72ee3a92d",
      "scripts": {},
      "_npmUser": {
        "name": "bpasero",
        "email": "benjpas@microsoft.com"
      },
      "repository": {
        "url": "git+https://github.com/microsoft/vscode-sudo-prompt.git",
        "type": "git"
      },
      "_npmVersion": "7.10.0",
      "description": "Run a command using sudo, prompting the user with an OS dialog if necessary",
      "directories": {},
      "_nodeVersion": "16.0.0",
      "_hasShrinkwrap": false,
      "_npmOperationalInternal": {
        "tmp": "tmp/sudo-prompt_9.3.0_1637150076875_0.6383373584086691",
        "host": "s3://npm-registry-packages"
      }
    },
    "9.3.1": {
      "name": "@vscode/sudo-prompt",
      "version": "9.3.1",
      "keywords": [
        "sudo",
        "os",
        "dialog",
        "prompt",
        "command",
        "exec",
        "user access control",
        "UAC",
        "privileges",
        "administrative",
        "elevate",
        "run as administrator"
      ],
      "author": {
        "name": "Joran Dirk Greef"
      },
      "license": "MIT",
      "_id": "@vscode/sudo-prompt@9.3.1",
      "maintainers": [
        {
          "name": "hticehurst",
          "email": "v-hticehurst@microsoft.com"
        },
        {
          "name": "rchiodo",
          "email": "rchiodo@microsoft.com"
        },
        {
          "name": "rebornix",
          "email": "penn.lv@gmail.com"
        },
        {
          "name": "bpasero",
          "email": "benjpas@microsoft.com"
        },
        {
          "name": "raymondzhao",
          "email": "raymondzhao@microsoft.com"
        },
        {
          "name": "mistople",
          "email": "ddossett@microsoft.com"
        },
        {
          "name": "kaimaetzel",
          "email": "kamaet@microsoft.com"
        },
        {
          "name": "connor.peet",
          "email": "connor@peet.io"
        },
        {
          "name": "roblourens",
          "email": "roblourens@gmail.com"
        },
        {
          "name": "chrmarti",
          "email": "chrmarti@microsoft.com"
        },
        {
          "name": "tyriar",
          "email": "tyriar@tyriar.com"
        },
        {
          "name": "jrieken",
          "email": "jrieken@microsoft.com"
        },
        {
          "name": "alexandrudima",
          "email": "alexdima@microsoft.com"
        },
        {
          "name": "tylerl0706",
          "email": "me@tylerleonhardt.com"
        },
        {
          "name": "miguelsolorio",
          "email": "miguel.solorio@microsoft.com"
        },
        {
          "name": "deepak_robo",
          "email": "hop2deep@gmail.com"
        },
        {
          "name": "aeschli",
          "email": "martinae@microsoft.com"
        }
      ],
      "homepage": "https://github.com/bpasero/sudo-prompt#readme",
      "bugs": {
        "url": "https://github.com/bpasero/sudo-prompt/issues"
      },
      "dist": {
        "shasum": "c562334bc6647733649fd42afc96c0eea8de3b65",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@vscode/sudo-prompt/-/sudo-prompt-9.3.1.tgz",
        "fileCount": 8,
        "integrity": "sha512-9ORTwwS74VaTn38tNbQhsA5U44zkJfcb0BdTSyyG6frP4e8KMtHuTXYmwefe5dpL8XB1aGSIVTaLjD3BbWb5iA==",
        "signatures": [
          {
            "sig": "MEUCICq4a3I7GTxLdz5QEVwbUf9P3xk0WISnclWrVjPTK0uxAiEAxmTwQuf+CyCV7m8Dbo6spjQbZOwh4Mp5kcgJIe4OIak=",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ],
        "unpackedSize": 47400,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl/KcCRA9TVsSAnZWagAAv7gP/AuNHw2FGNa+4qaqBz08\nGHE3Vv63YEGJMB2pcBxDoGtNU2ayiWDGj6K8fI2YLyguEu17HaCa2wmsaG3U\ngXhBeO2JT0rm+OosZv/XW5F1dXJiT+/ZwqYHiQ2sxeqcTAd4BXZZ5gIg//1i\nVLko/fUkQNX+POTY4I3oTV2+5FNb5qk66Nvag6ABta70Jx0N7ipWdVrKPgnQ\nl2qdvXQNIMxBHSogWPXdoLyb/PVO2lUZrP5q5cghiW3nxSaGgb3MpjlgRskL\nF4KOeD4IoplZ2Cs553oe6d0lw1V12Xd3bu7MN8bbj9Xt//kWWYAYzY5SrOkM\nxTpwU0xIV5ptsToJTjmLUfUn+ACw9azdS1muOt+7QbfvzUYtafO8C4qp4isI\nrMPvvH9So1YqRVwn6mGZJlsIapJfN8IA3rk+ZLr1ZbaihQxNPQtv38hwG3BK\nIJk79YPkJtTflydVi2+ryEtceoZ54+8f4WLUu8tpcH29xzA3U6uAZOHf5EHb\ngFioqytiUdJx8+WmwhGOYdK9x0YAu7W+2yDh4bb7AcCI4/2E2VAQp1Q0M4X4\nXmCE/ZQ0lN8+LlC/eOUjbD0LX/OtRIrKJ03duZYl9d6Y2ASArmEORzd/s619\nGAp/l4KnQsseB0P+pOvbWa080ti6B7Jik5Y4kJod29FfV34P5CiLkRZzcgdb\nrKQg\r\n=ZwZx\r\n-----END PGP SIGNATURE-----\r\n"
      },
      "main": "index.js",
      "types": "index.d.ts",
      "gitHead": "9b0a927f93b8fdd063fa7ad0e895c1e6d35e61ce",
      "scripts": {},
      "_npmUser": {
        "name": "bpasero",
        "email": "benjpas@microsoft.com"
      },
      "repository": {
        "url": "git+https://github.com/bpasero/sudo-prompt.git",
        "type": "git"
      },
      "_npmVersion": "7.10.0",
      "description": "Run a command using sudo, prompting the user with an OS dialog if necessary",
      "directories": {},
      "_nodeVersion": "16.0.0",
      "_hasShrinkwrap": false,
      "_npmOperationalInternal": {
        "tmp": "tmp/sudo-prompt_9.3.1_1637347996494_0.15431836897619977",
        "host": "s3://npm-registry-packages"
      }
    },
    "9.3.2": {
      "name": "@vscode/sudo-prompt",
      "version": "9.3.2",
      "keywords": [
        "sudo",
        "os",
        "dialog",
        "prompt",
        "command",
        "exec",
        "user access control",
        "UAC",
        "privileges",
        "administrative",
        "elevate",
        "run as administrator"
      ],
      "author": {
        "name": "Joran Dirk Greef"
      },
      "license": "MIT",
      "_id": "@vscode/sudo-prompt@9.3.2",
      "maintainers": [
        {
          "name": "kaimaetzel",
          "email": "kamaet@microsoft.com"
        },
        {
          "name": "lszomoru",
          "email": "lszomoru@microsoft.com"
        },
        {
          "name": "alexandrudima",
          "email": "alexdima@microsoft.com"
        },
        {
          "name": "sbatten",
          "email": "steven.m.batten@outlook.com"
        },
        {
          "name": "joaomoreno.ms",
          "email": "joao.moreno@microsoft.com"
        },
        {
          "name": "microsoft1es",
          "email": "npmjs@microsoft.com"
        },
        {
          "name": "rebornix",
          "email": "penn.lv@gmail.com"
        },
        {
          "name": "vscode-bot",
          "email": "vscode-bot-npm@microsoft.com"
        }
      ],
      "homepage": "https://github.com/microsoft/vscode-sudo-prompt#readme",
      "bugs": {
        "url": "https://github.com/microsoft/vscode-sudo-prompt/issues"
      },
      "tag": "latest",
      "dist": {
        "shasum": "692ba38df40bd3502ccc4e9f099fbbaedbd5f04e",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@vscode/sudo-prompt/-/sudo-prompt-9.3.2.tgz",
        "fileCount": 7,
        "integrity": "sha512-gcXoCN00METUNFeQOFJ+C9xUI0DKB+0EGMVg7wbVYRHBw2Eq3fKisDZOkRdOz3kqXRKOENMfShPOmypw1/8nOw==",
        "signatures": [
          {
            "sig": "MEUCIGQYKMtiWUGDnTI5AVwQieU4xAUl6WdKv2hpG+QAUv+tAiEAxU9Ako4cpBQZEenRX4jpd7abHv7dVNt5dNswFQSJ+xc=",
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
          }
        ],
        "unpackedSize": 44790
      },
      "main": "index.js",
      "_from": "file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App2\\temp\\e148631c-b928-4a0c-a700-8eb067f44286\\vscode-sudo-prompt-9.3.2.tgz",
      "types": "index.d.ts",
      "scripts": {},
      "_npmUser": {
        "name": "microsoft1es",
        "email": "npmjs@microsoft.com"
      },
      "_resolved": "M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App2\\temp\\e148631c-b928-4a0c-a700-8eb067f44286\\vscode-sudo-prompt-9.3.2.tgz",
      "_integrity": "sha512-gcXoCN00METUNFeQOFJ+C9xUI0DKB+0EGMVg7wbVYRHBw2Eq3fKisDZOkRdOz3kqXRKOENMfShPOmypw1/8nOw==",
      "repository": {
        "url": "git+https://github.com/microsoft/vscode-sudo-prompt.git",
        "type": "git"
      },
      "description": "Run a command using sudo, prompting the user with an OS dialog if necessary",
      "directories": {},
      "_nodeVersion": "18.5.0",
      "_hasShrinkwrap": false,
      "_npmOperationalInternal": {
        "tmp": "tmp/sudo-prompt_9.3.2_1767886097658_0.6659383890039119",
        "host": "s3://npm-registry-packages-npm-production"
      }
    }
  },
  "name": "@vscode/sudo-prompt",
  "time": {
    "created": "2021-11-17T11:54:36.824Z",
    "modified": "2026-07-08T07:57:38.657Z",
    "9.3.0": "2021-11-17T11:54:37.030Z",
    "9.3.1": "2021-11-19T18:53:16.624Z",
    "9.3.2": "2026-01-08T15:28:17.790Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/microsoft/vscode-sudo-prompt#readme"
}