# Repl(自訂命令列)

全名為Read-Eval-Print-Loop (REPL)

主要用來產生一個terminal終端機程式，可接受使用者從終端機的輸入做對應的輸出，或是直接將想顯示的文字輸出至終端機

一開始我們先開啟terminal，然後輸入node，進入node.js命令列

之後輸入`.help`

1.試著輸入`.editor`

然後打上如下程式

```
function welcome() {
  return `Hello!`;
}

welcome();
```

接著按下鍵盤的ctrl + D

即可看到Hello出現在terminal上

2.試著輸入 `.save ./test2.js`

發現剛才的程式存成檔案

3.再來可輸入 `.load ./test2.js` 可用來讀取並執行一個js檔案

4.點選鍵盤左上的`tab`按鈕可列出所有變數

5.試著輸入`fs.createReadStream('./test2.js');`

最後輸入兩次ctrl + C 即可退出nodejs命令列


---

# 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/class/repl-zi-ding-ming-ling-lie.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.
