I am trying to check if a directory exists as part of a command line application in node.js. However, fs does not seem to understand ~/ . For example, the following returns false ...
> fs.existsSync('~/Documents') false
... but this returns true ...
> fs.existsSync('/Users/gtmtg/Documents') true
... although they are both the same.
Why is this happening, and are there any workarounds for this? Thanks in advance!
gtmtg source share