don't you think that's a bit too much?
i'd rather keep this in a file name, because it'd make life harder to follow directory structure, and if you'd send someone the file, path would be lost.

Anyway, i've noticed that fs.makeDirectory is actually creating parent directories - try this out without "output" dir created in advance, and you'll end up with /output/example.com/ anyway.