UNIX Emulation in Javascript