facebook / facebook/jscodeshift
Inject data to transformer file?
- Dominant language
- JavaScript
- Stars
- 10k
- Forks
- 498
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
I'm currently trying to work with a transformer file that would receive injected data. It might be a non-standard usage of jscodeshift but this is the flow I'm currently trying to get working:
1. Run an [inquirer](https://github.com/SBoudrias/Inquirer.js/) prompt
2. Collect user's Answers
3. Pass answers to jscodeshift transformer file
4. Parse the AST of some file (that the user will have chosen), and add/update/modify a node there, depending on user answers.
Although not documented, I've found how to use jscodeshift without the CLI (running the default export of `src/Runner.js` and reconstructing the arguments), but unfortunately, there is no way to pass data to the transformer file.
It seems like passing data would be fairly trivial (https://github.com/gomesalexandre/jscodeshift/commit/ecf6c50968871b26435ae495642ede191c3ef93f).
Is that something that we would like to have? 🙏
Contributor guide
Assessment
This issue has not been assessed yet.