Removed dependency on bash script (using pure Javascript)