{"_id":"@balena/sudo-prompt","_rev":"42-a9e7291aa1cf2ea6220f0d36068d1096","name":"@balena/sudo-prompt","dist-tags":{"latest":"9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534"},"versions":{"9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534":{"name":"@balena/sudo-prompt","version":"9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534","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":"@balena/sudo-prompt@9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/jorangreef/sudo-prompt#readme","bugs":{"url":"https://github.com/jorangreef/sudo-prompt/issues"},"dist":{"shasum":"9cdbb15f47591ce9f8edd5dd060968c1f4aaed37","tarball":"https://registry.npmjs.org/@balena/sudo-prompt/-/sudo-prompt-9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534.tgz","fileCount":8,"integrity":"sha512-9s0EDAV4y8KsAc/hQ9rFaE1XlBYbN+/ASiShSowLkJbSUb50B/BqJTfTpUuiEs6d6zhNmPXa8Rn/bPeMW+tn0g==","signatures":[{"sig":"MEYCIQDwi8o0aTHElzYe5XdJEaRqvaTGVr89yhxK9ECjFShtDQIhAMPT82Q5Wkppi1yEojujHQyxrkZCs2+liCfHiYFqpbw5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzHJ4CRA9TVsSAnZWagAAfAIP/1BKvj/b37ftrH0fkCGk\nMXYRaeMwAagI7Zp06/yB96hYvmr2Y5mBHMpwLCXTOAr+Gp9k9c9iC2nCJdtc\n6VMmLnoryxRlz5q6cGgvhdCu3dTHMSF0VMRhUYn3LWms3wrOXrju6CWqoFz0\n0mXT9OpMfSZq4YNKHnl6nhxysCc3C++HeKPlxLkif425Oe4GQkOKAbnvBGQt\no6w3foyyrYCPFJHjfvU9Ixjho9DHJMlx4OOJrJJfN+WLPPAM5Nmob2B/vbO2\n9TPWkfMTukUI+GvnyZN/a62KIYjdncmB8Gtdo1annszWtLfoDVWnMxbaoNy4\nSMwhtBsBhxwkAERQ92PdBerJXbauGmvs1akf0GLpSpdaOTY43tElkZkO1d9D\nRuuYNDYwhqUchpuyVj+oE/zvlc8Uutth+oAfpdH3CG8t0txLE9s6c3213LD3\nuYJSxNaM8q2DK12zYCSnI5ui1jN1KSfeRF9kVOTs4WnO4K8pfs1Q35Wbpxu0\nSi2PW1eBcFQSNJWOLSb9Z8Qav0P0reCmC5irt+p+Abluqa4uDbE9DaHO8aC6\nMmRi4Z4uiWrNR/Y7Cruv2cLr6uW5CyZizKMN02b+Amlkv3QB9wgfXCJxShGX\n5VD1HpoL9HFddzNqBRiIiIE/DwGDBDtuJIVdQuWGbo3i0vLDB541/ftcZ7iW\nsYCH\r\n=tJYd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"index.d.ts","gitHead":"0849e215b947987a643fe5763902aea201255534","scripts":{},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/jorangreef/sudo-prompt.git","type":"git"},"versionist":{"publishedAt":"2021-10-05T12:38:07.483Z"},"_npmVersion":"6.14.15","description":"Run a command using sudo, prompting the user with an OS dialog if necessary","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sudo-prompt_9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534_1633437760273_0.5482124074428807","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"9.2.1-workaround-windows-amperstand-in-username-18d2d0999a13ee3bbeef34b7cfa809efc05a52e2":{"name":"@balena/sudo-prompt","version":"9.2.1-workaround-windows-amperstand-in-username-18d2d0999a13ee3bbeef34b7cfa809efc05a52e2","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":"@balena/sudo-prompt@9.2.1-workaround-windows-amperstand-in-username-18d2d0999a13ee3bbeef34b7cfa809efc05a52e2","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/jorangreef/sudo-prompt#readme","bugs":{"url":"https://github.com/jorangreef/sudo-prompt/issues"},"dist":{"shasum":"418a086bd6048b5c401dcbec4602fde48e91e318","tarball":"https://registry.npmjs.org/@balena/sudo-prompt/-/sudo-prompt-9.2.1-workaround-windows-amperstand-in-username-18d2d0999a13ee3bbeef34b7cfa809efc05a52e2.tgz","fileCount":8,"integrity":"sha512-7uPhVikef1xADs46i4fZnnnFPZa+X0R5nbTCbyZ6yli2HmJ5dbWYya+4CHjEBrk9H0myVBXN47/DAaE37gIaEg==","signatures":[{"sig":"MEYCIQDbV9txqm/DuSAwoYNJeLMVIR5ZSA/8/ikapZCqfW18sAIhAKESBg6ZCSOCq+wO4DFWxhOhJtYyZtI1An+gMH/m0/ur","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48398},"main":"index.js","types":"index.d.ts","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## 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('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","gitHead":"18d2d0999a13ee3bbeef34b7cfa809efc05a52e2","scripts":{},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/jorangreef/sudo-prompt.git","type":"git"},"versionist":{"publishedAt":"2021-10-05T12:52:37.206Z"},"_npmVersion":"6.14.15","description":"Run a command using sudo, prompting the user with an OS dialog if necessary","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/sudo-prompt_9.2.1-workaround-windows-amperstand-in-username-18d2d0999a13ee3bbeef34b7cfa809efc05a52e2_1633438520179_0.7712137517954831","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"9.2.1-workaround-windows-amperstand-in-username-e0f917dc46270b0c942b6428372ec7c19ca09db0":{"name":"@balena/sudo-prompt","version":"9.2.1-workaround-windows-amperstand-in-username-e0f917dc46270b0c942b6428372ec7c19ca09db0","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":"@balena/sudo-prompt@9.2.1-workaround-windows-amperstand-in-username-e0f917dc46270b0c942b6428372ec7c19ca09db0","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/jorangreef/sudo-prompt#readme","bugs":{"url":"https://github.com/jorangreef/sudo-prompt/issues"},"dist":{"shasum":"97a6f2bde93ce01a07536d9e09fe657326fd666a","tarball":"https://registry.npmjs.org/@balena/sudo-prompt/-/sudo-prompt-9.2.1-workaround-windows-amperstand-in-username-e0f917dc46270b0c942b6428372ec7c19ca09db0.tgz","fileCount":8,"integrity":"sha512-9Ip6Ed1qeUyvDPc2tHSUFOXIIUKwzuhSYuOuvmwwdtIH0OQYzCzv72tsChoozldNSR62CiitcKilOVFEN5pseQ==","signatures":[{"sig":"MEQCIGFU9BHvmG55tjTERUBLRTX/xgUCzmOZE0HpOojfi4EfAiA5U7q7kacbD2IMwsoQK9zxMasah1tY/5oiMpu7c4KXgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48741},"main":"index.js","types":"index.d.ts","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## 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('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","gitHead":"e0f917dc46270b0c942b6428372ec7c19ca09db0","scripts":{"test":"echo 'Tests require user interaction, see ad-hoc scripts'","test:all":"npm run test:classic && npm run test:concurrent","test:classic":"node test.js","test:concurrent":"node test-concurrent.js"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/jorangreef/sudo-prompt.git","type":"git"},"versionist":{"publishedAt":"2021-10-05T13:26:25.100Z"},"_npmVersion":"6.14.15","description":"Run a command using sudo, prompting the user with an OS dialog if necessary","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/sudo-prompt_9.2.1-workaround-windows-amperstand-in-username-e0f917dc46270b0c942b6428372ec7c19ca09db0_1633440543273_0.46058846433507594","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"9.2.1-add-author-14c184443fd55fe7892f0140acdc657ac99e7586":{"name":"@balena/sudo-prompt","version":"9.2.1-add-author-14c184443fd55fe7892f0140acdc657ac99e7586","keywords":["sudo","os","dialog","prompt","command","exec","user access control","UAC","privileges","administrative","elevate","run as administrator"],"license":"MIT","_id":"@balena/sudo-prompt@9.2.1-add-author-14c184443fd55fe7892f0140acdc657ac99e7586","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/jorangreef/sudo-prompt#readme","bugs":{"url":"https://github.com/jorangreef/sudo-prompt/issues"},"dist":{"shasum":"21b0801367b08ed1043b54469d057f5d85b07f96","tarball":"https://registry.npmjs.org/@balena/sudo-prompt/-/sudo-prompt-9.2.1-add-author-14c184443fd55fe7892f0140acdc657ac99e7586.tgz","fileCount":8,"integrity":"sha512-iO7GM/x44isvgdZG13F9V4nzV1EzPmyLqlRcBfv3YD/GrseQ06RtzvTpFSteHFq5k+jHI62v3EYoyqqgA+Xb4g==","signatures":[{"sig":"MEUCIQD/iLPOgwrWVbZQ2d7PchUb7cM42cIEdFVLU1OhXdCMPwIgCVGyoC9W7wZvnVV9Yx8yD0H3L3eBGIYNNQ0yPRZMC1k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48614},"main":"index.js","types":"index.d.ts","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## 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('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","authors":["Joran Dirk Greef","Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>"],"gitHead":"14c184443fd55fe7892f0140acdc657ac99e7586","scripts":{},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/jorangreef/sudo-prompt.git","type":"git"},"versionist":{"publishedAt":"2021-11-11T11:59:28.088Z"},"_npmVersion":"6.14.15","description":"Run a command using sudo, prompting the user with an OS dialog if necessary","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/sudo-prompt_9.2.1-add-author-14c184443fd55fe7892f0140acdc657ac99e7586_1636632123680_0.6153623705385578","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"10.0.0-ts-refactor-f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b":{"name":"@balena/sudo-prompt","version":"10.0.0-ts-refactor-f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b","keywords":["sudo","os","dialog","prompt","command","exec","user access control","UAC","privileges","administrative","elevate","run as administrator"],"license":"MIT","_id":"@balena/sudo-prompt@10.0.0-ts-refactor-f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/balena-io-modules/sudo-prompt#readme","bugs":{"url":"https://github.com/balena-io-modules/sudo-prompt/issues"},"dist":{"shasum":"976c17b2042a85899c6e23b69db4b1d53d8295a8","tarball":"https://registry.npmjs.org/@balena/sudo-prompt/-/sudo-prompt-10.0.0-ts-refactor-f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b.tgz","fileCount":7,"integrity":"sha512-xLXTn5o8PNAFGnMwlPaDzQkxixBo1Idv5AHLRKp1TJr87XO0YFaOqroLwXnQ2+THih3hQve4GzLIPV8XBP3RKQ==","signatures":[{"sig":"MEUCIQD9zcFnA2vgwOKlUfEhz5yinmf1gAaz79ReiWs6r6ww3gIgUpUjnLNVyOK9TsshgOpKYR3aZ75ta3ND76Qcxv5C9ZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50786},"main":"build/index.js","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## 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('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","authors":["Joran Dirk Greef","Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>"],"gitHead":"f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b","scripts":{"test":"echo 'Tests require user interaction, see ad-hoc scripts'","build":"tsc","test:all":"npm run test:classic && npm run test:concurrent","postinstall":"npm run build","test:classic":"ts-node tests/classic.ts","test:concurrent":"ts-node tests/concurrent.ts"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/balena-io-modules/sudo-prompt.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T13:57:53.707Z"},"_npmVersion":"6.14.15","description":"Run a command using sudo, prompting the user with an OS dialog if necessary","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ts-node":"10.2.1","typescript":"4.4.3","@types/node":"16.11.7"},"_npmOperationalInternal":{"tmp":"tmp/sudo-prompt_10.0.0-ts-refactor-f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b_1636984805179_0.9214888137680755","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."}},"time":{"created":"2021-10-05T12:42:40.224Z","modified":"2026-01-29T10:03:45.248Z","9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534":"2021-10-05T12:42:40.439Z","9.2.1-workaround-windows-amperstand-in-username-18d2d0999a13ee3bbeef34b7cfa809efc05a52e2":"2021-10-05T12:55:20.365Z","9.2.1-workaround-windows-amperstand-in-username-e0f917dc46270b0c942b6428372ec7c19ca09db0":"2021-10-05T13:29:03.482Z","9.2.1-add-author-14c184443fd55fe7892f0140acdc657ac99e7586":"2021-11-11T12:02:03.853Z","10.0.0-ts-refactor-f285a5327bf81c0b7bcaaa083e5fe9fd20625a4b":"2021-11-15T14:00:05.313Z"},"bugs":{"url":"https://github.com/jorangreef/sudo-prompt/issues"},"author":{"name":"Joran Dirk Greef"},"license":"MIT","homepage":"https://github.com/jorangreef/sudo-prompt#readme","keywords":["sudo","os","dialog","prompt","command","exec","user access control","UAC","privileges","administrative","elevate","run as administrator"],"repository":{"url":"git+https://github.com/jorangreef/sudo-prompt.git","type":"git"},"description":"Run a command using sudo, prompting the user with an OS dialog if necessary","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"readme":"","readmeFilename":""}