>Rewriting it in JavaScript or C# may take longer.
This is very true. If we look at Exchange, as an example, most of it was ported to .NET between E12 (2007) and E14 (2010) but Information Store wasn't able to be fully ported to C# until E15 (2013)[0,1].
[0] - https://docs.microsoft.com/en-us/exchange/managed-store-exch...
[1] - https://en.wikipedia.org/wiki/History_of_Microsoft_Exchange_...