hygen
hygen copied to clipboard
How do I access Helpers from Prompts?
I want to only ask for inputs if I don't already have them
const h = require('hygen/helpers') // <===== Error: Cannot find module 'hygen/helpers'
module.exports = [
{
type: 'input',
name: 'dev_email',
message: "Please enter your dev_email prior to the @ symbol, which Kubernetes doesn't allow in string fields:",
skip: () => h.isLocal('dev_email')
},
Of course that would mean that helpers had access to local variables defined within the hygen execution
const locals = require('hygen/locals') // <===== Error: Cannot find module 'hygen/locals'
module.exports = {
helpers: {
isLocal: tag => !!locals[tag]
}
}
How to I access the execution space of the interpolater? It has all the data I need?