Difference between path.normalize and path.resolve in Node.js

前端 未结 2 1856
予麋鹿
予麋鹿 2021-01-29 23:39

What is the difference (if any) between path.normalize(your_path) and path.resolve(your_path)?

I know path.resolve(...) can accept

2条回答
  •  误落风尘
    2021-01-30 00:36

    From the docs:

    Another way to think of resolve is as a sequence of cd commands in a shell.

    Links to path.resolve and path.normalize in the documentation. I mostly don't want to just provide links in an answer but the Node.js docs are very decent.

提交回复
热议问题