Closed Raiper34 closed 6 months ago
For future, you can use prompt.js with params like
const fs = require('fs');
const BASE_ASSETS_FOLDER = './raw';
module.exports =
{
params: ({args}) => {
// use fs (or similar) to read data
// process data
// add to args
// anything you add to args available in templates
args.assets = fs.readdirSync(BASE_ASSETS_FOLDER).filter(folder => !folder.includes('.'))
return args
}
}
and then you can use assets
variable in template :)
Hi, is possible to use node code in hygen? I am new to hygen and have not found answers. I use my helper script for generating asset map, but I want to replace it with hygen. My script first get structure of given folder and based that folder i generate asset map. Can I run node code in hygen to get folder structure like this?
Thanks!