Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: explain why path.posix.normalize does not replace windows slashes #12700

Closed
wants to merge 6 commits into from
10 changes: 10 additions & 0 deletions doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this note belongs in the normalize() documentation, not as a different subsection in path.posix.

Copy link
Contributor Author

@sjlehn sjlehn Apr 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I still give it a heading or would it be better as just a note after "For Example, on POSIX" at 327

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't give it a heading.

The `path.posix.normalize()` method will not attempt to convert / (Windows) to
\ (POSIX), as / is not recognized by POSIX as a valid directory separator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't / a valid directory separator on POSIX??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duh...should have realized I had that backwards

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comment may have these backwards. The windows separator \ is not recognized by POSIX as a valid separator.


For example:
```js
path.posix.normalize("/some/thing/like/this")
//Returns '/some/thing/like/this'
```

## path.relative(from, to)
<!-- YAML
added: v0.5.0
Expand Down