Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/.nvm/versions/node/v18.17.1/lib/node_modules/npm/lib/utils/ drwxr-xr-x | |
| Viewing file: Select action/file-type: const readline = require('readline')
const open = require('./open-url.js')
function print (npm, title, url) {
const json = npm.config.get('json')
const message = json ? JSON.stringify({ title, url }) : `${title}:\n${url}`
npm.output(message)
}
// Prompt to open URL in browser if possible
const promptOpen = async (npm, url, title, prompt, emitter) => {
const browser = npm.config.get('browser')
const isInteractive = process.stdin.isTTY === true && process.stdout.isTTY === true
try {
if (!/^https?:$/.test(new URL(url).protocol)) {
throw new Error()
}
} catch (_) {
throw new Error('Invalid URL: ' + url)
}
print(npm, title, url)
if (browser === false || !isInteractive) {
return
}
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
const tryOpen = await new Promise(resolve => {
rl.on('SIGINT', () => {
rl.close()
resolve('SIGINT')
})
rl.question(prompt, () => {
resolve(true)
})
if (emitter && emitter.addListener) {
emitter.addListener('abort', () => {
rl.close()
// clear the prompt line
npm.output('')
resolve(false)
})
}
})
if (tryOpen === 'SIGINT') {
throw new Error('canceled')
}
if (!tryOpen) {
return
}
await open(npm, url, 'Browser unavailable. Please open the URL manually')
}
module.exports = promptOpen
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0038 ]-- |