Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
meleklassoued opened this issue Apr 15, 2024 · 2 comments
Open

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

meleklassoued opened this issue Apr 15, 2024 · 2 comments

Comments

@meleklassoued
Copy link

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
Copy link
Member

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.

@meleklassoued meleklassoued changed the title Can plop generate files from json files inputs ? Can plop produce files based on json file inputs? Apr 18, 2024
@awhitford
Copy link

I have this desire too -- to be able to import prompt values from a json file rather than use the command-line. (My workaround is to write a shell script that translates the json file into command-line parameters.)

I'm not really understanding the advice from @amwmedia. I see that each action supports a data property, but the json file should influence the prompts (not actions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants