From c6f50de6530da6a615a1e575acd59f4ab9677e5f Mon Sep 17 00:00:00 2001 From: Steven Lehn Date: Thu, 27 Apr 2017 11:22:03 -0500 Subject: [PATCH 1/6] docs: explain why path.posix.normalize does not replace windows slashes Add section to path docs that explains that path.posix.normalize does not replace Windows slashes with POSIX slashes because POSIX does not recognize / as a valid path separator. Fixes: https://github.com/nodejs/node/issues/12298 --- doc/api/path.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/path.md b/doc/api/path.md index d9452b00dbfd48..159cff5e3a0cfa 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -416,6 +416,16 @@ added: v0.11.15 The `path.posix` property provides access to POSIX specific implementations of the `path` methods. +### path.posix.normalize(path) +The `path.posix.normalize()` method will not attempt to convert / (Windows) to \ (POSIX), as / is not recognized by +POSIX as a valid directory separator. + +For example: +```js +path.posix.normalize("/some/thing/like/this") +//Returns '/some/thing/like/this' +``` + ## path.relative(from, to)