I would like to run a JS function when a specific section of a file changes. The contents that are being watched should be selected by Regex.
As far as I have seen, libraries like Chokidar can only detect changes to a file directly and do not provide information about the contents of the file before and after the changes.
I ended up creating a slightly adjusted version of Prashant Pokhriyal's answer.