function showUsage(isRunning, options, restart) { if (isRunning) { if (restart) { showKillError(); } else { warn('[!] ' + config.name + '@' + config.version + ' is running'); } } else { info('[i] ' + config.name + '@' + config.version + (restart ? ' restarted' : ' started')); } var port = /^\d+$/.test(options.port) && options.port > 0 ? options.port : config.port; var list = options.host ? [options.host] : getIpList(); info('[i] 1. use your device to visit the following URL list, gets the ' + colors.bold('IP') + ' of the URL you can access:'); info(list.map(function(ip) { return ' http://' + colors.bold(ip) + (port ? ':' + port : '') + '/'; }).join('\n')); warn(' Note: If all the above URLs are unable to access, check the firewall settings'); warn(' For help see ' + colors.bold('https://github.com/avwo/whistle')); info('[i] 2. configure your device to use ' + config.name + ' as its HTTP and HTTPS proxy on ' + colors.bold('IP:') + port); info('[i] 3. use ' + colors.bold('Chrome') + ' to visit ' + colors.bold('http://' + (options.localUIHost || config.localUIHost) + '/') + ' to get started'); if (parseInt(process.version.slice(1), 10) < 6) { warn(colors.bold('\nWarning: The current Node version is too low, access https://nodejs.org to install the latest version, or may not be able to Capture HTTPS CONNECTs\n')); } }
function isNodeVersionLE8(version) { if (version === void 0) { version = process.version; } if (!version) { return false; } return semver.satisfies(version, '<9'); }
(() => { const [a, b, c] = process.version.split('.'); return (+a.slice(1) * 0x1000) + (+b * 0x100) + +c >= 38912; })()
static onCheckParams({ method = DEFAULT_METHOD }) { if (typeof method !== 'string' || method === '') { throw Error('\'method\' must be set'); } const cipherNames = Object.keys(ciphers); if (!cipherNames.includes(method)) { throw Error(`'method' must be one of [${cipherNames}]`); } if (method === 'chacha20-ietf' && !process.version.startsWith('v10')) { throw Error('require Node.js v10.x to run "chacha20-ietf"'); } }
function errorMessage () { // copied from npm's lib/utils/error-handler.js var os = require('os') log.error('System', os.type() + ' ' + os.release()) log.error('command', process.argv .map(JSON.stringify).join(' ')) log.error('cwd', process.cwd()) log.error('node -v', process.version) log.error('node-gyp -v', 'v' + prog.package.version) }
function checkVersion() { const version = parseFloat(process.version.replace('v', '')); if (version < 6) { log.info('Your Node.js version is not supported. You must install Node.js >= 6.0'); return false; } return true; }
testFsPatch().then(() => { console.log('Node ' + process.version + ' successfully built with xbin') process.exit(0) }, (error) => { console.error(error) process.exit(1) })
getDeliverableAsync () { if (this.download) { return getHttpResponseAsync(isString(this.download) ? this.download : [process.platform, process.arch, process.version.slice(1)].join('-') ) } return Promise.resolve(createReadStream(this.deliverableLocation)) }
// Inspired by "create-react-app". Thanks @gaearon :) function checkNodeVersion() { var semver = require('semver'); if (!semver.satisfies(process.version, packageJson.engines.node)) { console.error( 'You are currently running Node %s but %s requires %s. Please use a supported version of Node.\n', process.version, packageJson.name, packageJson.engines.node ); process.exit(1); } }
isSupportedNodeVersion() { if (engines && engines.node) { return semver.satisfies(process.version, engines.node); } return true; }
getDeliverableAsync() { if (this.download) { return getHttpResponseAsync(isString(this.download) ? this.download : [process.platform, process.arch, process.version.slice(1)].join('-')); } return _bluebird.Promise.resolve((0, _fs.createReadStream)(this.deliverableLocation)); }
(() => { const [a, b, c] = process.version.split('.'); return (+a.slice(1) * 0x1000) + (+b * 0x100) + +c >= 38912; })()
export function isNodeVersionLE8( version: string | null = process.version ): boolean { if (!version) { return false } return semver.satisfies(version, '<9') }
static onCheckParams({ method = DEFAULT_METHOD }) { if (typeof method !== 'string' || method === '') { throw Error('\'method\' must be set'); } const cipherNames = Object.keys(ciphers); if (!cipherNames.includes(method)) { throw Error(`'method' must be one of [${cipherNames}]`); } if (method === 'chacha20-ietf' && !process.version.startsWith('v10')) { throw Error('require Node.js v10.x to run "chacha20-ietf"'); } }