Convert coffee file to pure js