I can’t tell the scope of your project, particularly what sort of real time performance you need to achieve. You might want to look at the Chilipepper and CNC.JS projects as examples of how it has been done. Both of those focus on maximizing Gcode delivery performance while monitoring and displaying the return status channel.
Be aware that the G2core api is optimized for G2core hardware that supppots I/O that is not available in tinyG.