move JS realtime to a file