Writing tool in Javascript instead for browser