Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
return !reason
}
})
// get answers
const answers = await inquirer.prompt(questions)
// merge in defaults
const values = Object.assign({}, defaults, answers)
// return merge
return values
} catch (err) {
return Promise.reject(
new Errlop('Failed to fetch the answers from the user', err)
)
}
}
process.on('unhandledRejection', function unhandledRejection(error) {
console.error(new Errlop('An unhandled promise failed', error))
process.exit(-1)
})
/^# CUSTOM/i.test(line)
)
if (localCustomIndex !== -1) {
const remoteLines = data.split('\n')
const remoteCustomIndex = remoteLines.findIndex(line =>
/^# CUSTOM/i.test(line)
)
data = remoteLines
.slice(0, remoteCustomIndex)
.concat(localLines.slice(localCustomIndex))
.join('\n')
}
}
return write(file, data)
} catch (err) {
return Promise.reject(new Errlop(`Download of ${opts.url} FAILED`, err))
}
}
async function getNodeLTSVersions() {
const url =
'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json'
try {
const response = await fetch(url)
const json = await response.json()
const lts = Object.entries(json)
return lts
} catch (err) {
throw new Errlop(`failed to fetch node.js LTS releases from ${url}`, err)
}
}
async function getMinimumNodeLTSVersion() {
safeps.exec(command, opts, function(err, stdout) {
if (err) return reject(new Errlop(`exec failed: ${command}`, err))
return resolve(stdout)
})
})