Hi! If you already have implemented functionality and you're comfortable with the result, in my opinion, recoding just to adapt to a framework can be very steep. I don't recommend it actually unless you can see clearly that what the framework offers is beneficial for you. I'm not so sure about the performance hit, but if you don't really need them, I'd recommend as 'No Time To Play' says.
On the other hand, I disagree with 'Guruhebat' recommendation. Turning to Unity is not a sensible maneuver here. You'll have to recode everything to C# and adapt to Unity cycle of life. Unity, actually, doesn't make use of JavaScript, it made use of a script similar to JavaScript in appearance called UnityScript, and at the moment, it's discontinued.
Here some forum posts from the Unity forum about this subject:
https://forum.unity.com/threads/is-unity-planning-to-kill-javascript-support.403...
And an old wiki entry about it:
https://wiki.unity3d.com/index.php/UnityScript_versus_JavaScript
Good luck!