Bash built-ins, the Javascript way