Add js function for real time compiling