'Denormalizing path separator in Node.js under Windows

In Windows, path module of Node.js produces all paths with backslash. It seems like it calls its own normalize() function when other functions (like resolve()) are called.

Is there a way to de-normalize the paths (with forward slash), without explicit replacement all over the place?

I tried setting path.sep = '/', but resolve() still produces paths with \\.



Solution 1:[1]

You can path.sep or path.parse to disassemble path and then join it as you like.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 aleclarson