Monday, 24 April 2017

Node.js - How to cross-platform find the 'desktop' directory path?

As mentioned in http://stackoverflow.com/a/32556337/103396, require('os').homedir() is the way to get the user's home directory.

In Windows the desktop path would be on user_home_dir/Desktop:

require('path').join(require('os').homedir(), 'Desktop')

Will this work on other platforms?



via swordf1zh

No comments:

Post a Comment