# Pengenalan Node JS

Node JS memungkinkan javascript untuk bekerja di sisi server.

### Installasi NodeJS

Installasi NodeJS bisa dilakukan dengan mendownload melalui halaman <https://nodejs.org/en/download/> dan pilih versi LTS. Ikuti langkah-langkah yang disampaikan ketika melakukan instalasi.&#x20;

Untuk mengecek apakah installasi berhasil dengan baik, ketik perintah berikut :\
`node -v`\
`npm -v` \
npm adalah node package manager untuk mengelola paket-paket library di javascript.&#x20;

### Get Started

{% code title="index.js" %}

```javascript
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Selamat Pagi!');
}).listen(8080);
```

{% endcode %}

Jalankan dengan perintah `node index.js`

Kemudian buka browser localhost:8080


---

# 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://seri-belajar-pemrograman.rijalasepnugroho.com/node-js/pengenalan-node-js.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.
