Node-Webkit get user's Desktop directory

Using Node-Webkit, I need to save a file with fs.writeFile() on the user's desktop directory.

How can I retrieve that?

Under unix you can use the environment variable HOME and under windows USERPROFILE to identify the users home folder and concatenate that with "/Desktop".