I'm on node 0.10.X and I don't have access to a Windows machine.
re: https://nodejs.org/api/path.html
When I do:
p = path.resolve(someAbsolutePath).replace(/\\/g, '/');
Do I expect p
to start with c:/
or /
?
Thanks
Solution that works for linux and windows, without extra conditions:
path.resolve(__dirname, '..', 'src', 'index.html')
will be changed to:
'../src/index.html'
on linux
'..\src\index.html'
on windows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With