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

Support async replacement #95

Open
perrin4869 opened this issue Jun 17, 2018 · 5 comments
Open

Support async replacement #95

perrin4869 opened this issue Jun 17, 2018 · 5 comments

Comments

@perrin4869
Copy link

This could be useful when doing an async calculation of the replacement text (for example, compiling some javascript, etc).
I could try to put together a PR this week :)

@perrin4869
Copy link
Author

I am thinking to add a new async option, besides skipBinary.
When true, the replacement function will return a promise.
Since neither String.prototype.replace nor replacestream support a replacement function that resolves, the logic for the async case would be separate from the sync one... basically converting the vinyl file's contents to a string, and then executing the replacement asynchronously.

@perrin4869
Copy link
Author

The other option would be to export a separate, async version of the plugin

@LvChengbin
Copy link

@perrin4869 did the async version release?

@mrweiner
Copy link

@lazd any chance of getting this feature added, given that a PR doesn't seem to have ever been created?

@lazd
Copy link
Owner

lazd commented Sep 15, 2022

@mrweiner super low without a PR, I don't have incentive or time to add this feature myself.

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

4 participants