plopjs / plop

Consistency Made Simple
http://plopjs.com
MIT License
7.06k stars 277 forks source link

Can plop produce files based on json file inputs? #432

Open meleklassoued opened 5 months ago

meleklassoued commented 5 months ago

Description :

I want to generate some files using pre-prepared templates. I'd like to pass a JSON file to the prompt, which will allow for the direct generation of the templates based on its content.

amwmedia commented 5 months ago

You should be able to use the normal node API to load and parse data out of a JSON file and pass it to actions that you want to execute. Each Action supports a data prop as part of the API. An object passed to this prop will be merged with user answer data before running the action.