Is there some difference between the following invocations?
path.join(__dirname, \'app\')
vs.
path.resolve(__dirname, \'app
1) path.resolve creates the absolute path.
The method creates absoulte path from right to left until an absolute path is constructed.
For example:
path.resolve('/a', 'b', 'c'); // C:\a\b\c
path.resolve('/a', '/b', 'c'); // C:\b\c
path.resolve('/a', '/b', '/c'); // C:\c
If absolute path is not generated, the method using current working directory:
For example:
path.resolve('a', 'b', 'c'); // C:\{current_working_directory}\a\b\c
2) path.join joins all path and the normalize the result
For example:
path.join('/a', '/b', '/c'); // \a\b\c
path.join('/a', '/b', 'c'); // \a\b\c
path.join('/a', 'b', 'c'); // \a\b\c
path.join('a', 'b', 'c'); // \a\b\c