adamreisnz / replace-in-file

A simple utility to quickly replace contents in one or more files
580 stars 65 forks source link

Is it possible to use this lib for replacements in a text, not in file(s)? #176

Closed azakharo closed 8 months ago

azakharo commented 10 months ago

Hello! I have a text and need to make multiple replacements in it. Can I use this lib for that? I understand that I can put my text into some temporary file and call the lib. But is there a simpler way to do the job? Thank you for the library!

adamreisnz commented 10 months ago

Hello, just use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace, which this package uses under the hood as well.

There is no need to use this package unless you are making replacements in files.

Cheers

On Mon, Dec 11, 2023, 22:04 Alexey Zakharov @.***> wrote:

Hello! I have a text and need to make multiple replacements in it. Can I use this lib for that? I understand that I can put my text into some temporary file and call the lib. But is there a simpler way to do the job? Thank you for the library!

— Reply to this email directly, view it on GitHub https://github.com/adamreisnz/replace-in-file/issues/176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXYQUHK4BHSBOANI64WH3YI3EA5AVCNFSM6AAAAABAPMV2EWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTKMJWG42DKOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>