Skip to content

Commit 5739c3f

Browse files
authored
Merge pull request #541 from numaanahmed3110/patch-1
Update instructions_to_run_generated_code.md
2 parents 6fcc698 + 35287cc commit 5739c3f

File tree

1 file changed

+96
-2
lines changed

1 file changed

+96
-2
lines changed

Diff for: doc/user_guide/instructions_to_run_generated_code.md

+96-2
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,105 @@ TODO
205205

206206
## node.js (JavaScript, axios)
207207

208-
TODO
208+
### 1.Install Node.js:
209+
Ensure Node.js and npm are installed. Verify by running:
210+
211+
```bash
212+
node --version
213+
npm --version
214+
```
215+
216+
If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.
217+
218+
Initialize a new Node.js project:
219+
220+
```bash
221+
npm init -y
222+
```
223+
224+
Install Axios:
225+
226+
```bash
227+
npm install axios
228+
```
229+
230+
### 2.Set Up a New Project:
231+
Create a new project directory:
232+
233+
```bash
234+
mkdir node-axios-example
235+
cd node-axios-example
236+
```
237+
238+
Initialize the project:
239+
240+
```bash
241+
npm init -y
242+
```
243+
244+
### 3.Create and Run the Code:
245+
246+
Save the generated code in a file(e.g., `app.js`).
247+
248+
Run the code:
249+
250+
```bash
251+
node app.js
252+
```
209253

210254
## node.js (JavaScript, fetch)
211255

212-
TODO
256+
### 1. Install Node.js:
257+
Ensure Node.js and npm are installed. Verify by running:
258+
259+
```bash
260+
node --version
261+
npm --version
262+
```
263+
264+
If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.
265+
266+
Initialize a new Node.js project:
267+
268+
```bash
269+
npm init -y
270+
```
271+
272+
If using Node.js 18 or newer, the Fetch API is already built-in.
273+
274+
For older versions, install the `node-fetch` package:
275+
276+
```bash
277+
npm install node-fetch
278+
```
279+
280+
### 2. Set Up a New Project:
281+
Create a project directory:
282+
283+
```bash
284+
mkdir node-fetch-example
285+
cd node-fetch-example
286+
```
287+
288+
Initialize the project:
289+
290+
```bash
291+
npm init -y
292+
```
293+
294+
### 3.Create and Run the Code:
295+
Save the generated code in a file( e.g., `app.js`).
296+
If using `node-fetch`, add the following line to the top of the file:
297+
298+
```javascript
299+
const fetch = require('node-fetch');
300+
```
301+
302+
Run the file:
303+
304+
```bash
305+
node app.js
306+
```
213307

214308
## Java (asynchttpclient)
215309

0 commit comments

Comments
 (0)