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

why not use path.posix ? #26

Closed
pq1949 opened this issue Aug 9, 2018 · 7 comments
Closed

why not use path.posix ? #26

pq1949 opened this issue Aug 9, 2018 · 7 comments

Comments

@pq1949
Copy link

pq1949 commented Aug 9, 2018

http://nodejs.cn/api/en/path.html#path_path_posix

@anodynos
Copy link
Owner

I am not familiar with it, nor I can really understand what it does from the limited docs:


path.posix#

Added in: v0.11.15

The path.posix property provides access to POSIX specific implementations of the path methods.


What are you suggesting?

@pq1949
Copy link
Author

pq1949 commented Aug 16, 2018

image

if we just want this feature , path.posix is enougth
path.win32 is windows style path \
path.posix is unix style path. /

@pq1949 pq1949 closed this as completed Aug 16, 2018
@pq1949 pq1949 reopened this Aug 16, 2018
@anodynos
Copy link
Owner

Can you give some examples of how it's used that is the same or similar to upath?

@rswalkden
Copy link

@pq1949 path.posix won't replace the backslashes. If you run:
path.posix.normalize('c:\\test\\test.jpg') it'll just spit "c:\\test\\test.jpg" right back at you.

@pq1949
Copy link
Author

pq1949 commented Sep 13, 2018

@rswalkden @anodynos
I have known the differentia ,thank you for your answers
image

@pq1949 pq1949 closed this as completed Sep 13, 2018
@anodynos
Copy link
Owner

I'm glad upath does it better :-)
And it's such a few lines of code...

@pq1949
Copy link
Author

pq1949 commented Sep 16, 2018

@anodynos yeah,nice work! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants