An open API service indexing awesome lists of open source software.

https://github.com/mazipan/how-to-call-api-in-nodejs

❓ How to make an API call in Node.js
https://github.com/mazipan/how-to-call-api-in-nodejs

fetch-api javascript nodejs tutorial

Last synced: 11 months ago
JSON representation

❓ How to make an API call in Node.js

Awesome Lists containing this project

README

          

# ❓ how-to-call-api-in-nodejs

## Article (in Bahasa Indonesia)

https://mazipan.space/cara-fetch-api-di-nodejs

## Installations

```shell
# Install pnpm
$ npm i -g pnpm

# Install dependencies
$ pnpm i
```

### 1. Native Node.js

Code on [src/01-native-https.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/01-native-https.js)

Test API Call:

```shell
$ pnpm run call:1
```

### 2. Node Fetch

Code on [src/02-node-fetch.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/02-node-fetch.js)

Test API Call:

```shell
$ pnpm run call:2
```

### 3. Axios

Code on [src/03-axios.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/03-axios.js)

Test API Call:

```shell
$ pnpm run call:3
```

### 4. SuperAgent

Code on [src/04-superagent.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/04-superagent.js)

Test API Call:

```shell
$ pnpm run call:4
```

### 5. Got

Code on [src/05-got.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/05-got.js)

Test API Call:

```shell
$ pnpm run call:5
```

### 6. Exec-Sync

Code on [src/06-exec-sync.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/06-exec-sync.js)

Test API Call:

```shell
$ pnpm run call:6
```

### 7. ShellJS

Code on [src/07-shell.js](https://github.com/mazipan/how-to-call-api-in-nodejs/blob/master/src/07-shell.js)

Test API Call:

```shell
$ pnpm run call:7
```