# path

## path.join  用於連結路徑

開啟cmd輸入node，再輸入

```
path.join("aa", "foo");
```

Unix系统是”/“，Windows系统是”\“。所以用path.join可正確連結

## path.resolve 返回絕對路徑

一樣在REPL輸入

```
path.resolve('foo/bar', '/tmp/file/')
```

## path.relative 返回兩個參數之間的相對路徑

```
path.relative('/data/apple', '/data/banana')
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://easonwang.gitbook.io/web_advance/chapter1/path.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
