Skip to content

Update instructions_to_run_generated_code.md #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 96 additions & 2 deletions doc/user_guide/instructions_to_run_generated_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,105 @@ TODO

## node.js (JavaScript, axios)

TODO
### 1.Install Node.js:
Ensure Node.js and npm are installed. Verify by running:

```bash
node --version
npm --version
```

If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.

Initialize a new Node.js project:

```bash
npm init -y
```

Install Axios:

```bash
npm install axios
```

### 2.Set Up a New Project:
Create a new project directory:

```bash
mkdir node-axios-example
cd node-axios-example
```

Initialize the project:

```bash
npm init -y
```

### 3.Create and Run the Code:

Save the generated code in a file(e.g., `app.js`).

Run the code:

```bash
node app.js
```

## node.js (JavaScript, fetch)

TODO
### 1. Install Node.js:
Ensure Node.js and npm are installed. Verify by running:

```bash
node --version
npm --version
```

If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.

Initialize a new Node.js project:

```bash
npm init -y
```

If using Node.js 18 or newer, the Fetch API is already built-in.

For older versions, install the `node-fetch` package:

```bash
npm install node-fetch
```

### 2. Set Up a New Project:
Create a project directory:

```bash
mkdir node-fetch-example
cd node-fetch-example
```

Initialize the project:

```bash
npm init -y
```

### 3.Create and Run the Code:
Save the generated code in a file( e.g., `app.js`).
If using `node-fetch`, add the following line to the top of the file:

```javascript
const fetch = require('node-fetch');
```

Run the file:

```bash
node app.js
```

## Java (asynchttpclient)

Expand Down