1. This is generally useful 2. We already have `tmpdir()` 3. It is required for repl history support /cc @a8m @sindresorhus