DEV Community

Discussion on: How to get the current home directory of the user in Node.js?

Collapse
 
aschmelyun profile image
Andrew Schmelyun • Edited

You can also use the method directly with esm:

import { homedir } from 'os'

const userHomeDir = homedir()
Enter fullscreen mode Exit fullscreen mode
Collapse
 
melvin2016 profile image
MELVIN GEORGE

Thanks for sharing it, Andrew.