Skip to content

Commit 35287cc

Browse files
authored
Update instructions_to_run_generated_code.md
1 parent e0de4a2 commit 35287cc

File tree

1 file changed

+38
-85
lines changed

1 file changed

+38
-85
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 38 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -197,125 +197,86 @@ TODO
197197

198198
## JavaScript (axios)
199199

200-
`Axios` is a promise-based HTTP client for the browser and Node.js.
201-
### 1. Installation:
202-
-Ensure Node.js and npm are installed. Verify by running:
200+
TODO
201+
202+
## JavaScript (fetch)
203+
204+
TODO
205+
206+
## node.js (JavaScript, axios)
207+
208+
### 1.Install Node.js:
209+
Ensure Node.js and npm are installed. Verify by running:
203210

204211
```bash
205212
node --version
206213
npm --version
207214
```
208-
-If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.
209215

210-
-Initialize a new Node.js project:
216+
If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.
217+
218+
Initialize a new Node.js project:
211219

212220
```bash
213221
npm init -y
214222
```
215223

216-
-Install Axios:
224+
Install Axios:
217225

218226
```bash
219227
npm install axios
220228
```
221229

222-
### 2. Running the Generated Code::
223-
-Create a new JavaScript file (`e.g., app.js`).
224-
-Copy and paste the generated code into this file.
225-
-Open a terminal and navigate to the project directory.
226-
-Run the script:
230+
### 2.Set Up a New Project:
231+
Create a new project directory:
227232

228233
```bash
229-
node app.js
234+
mkdir node-axios-example
235+
cd node-axios-example
230236
```
231237

232-
## JavaScript (fetch)
233-
234-
macOS, Linux, and Windows:
235-
### 1. Node.js:
236-
-Follow the same steps as above to install Node.js.
238+
Initialize the project:
237239

238-
### 2. Set Up a New Project:
239-
-Create a new project folder and navigate into it
240-
```bash
241-
mkdir fetch-example
242-
cd fetch-example
243-
```
244-
-Initialize the project:
245240
```bash
246241
npm init -y
247242
```
248243

249-
### 3. Ensure Fetch API Support:
250-
-Starting with Node.js 18, the Fetch API is built-in. Verify the version:
244+
### 3.Create and Run the Code:
251245

252-
```bash
253-
node --version
254-
```
246+
Save the generated code in a file(e.g., `app.js`).
255247

256-
-If you’re using an earlier version, install a Fetch polyfill:
248+
Run the code:
257249

258250
```bash
259-
npm install node-fetch
251+
node app.js
260252
```
261253

262-
### 4. Create and Run the Code:
263-
-Save the generated code in a file, e.g., fetch_example.js.
264-
-If using node-fetch, add this line at the top of your file:
265-
266-
```bash
267-
const fetch = require('node-fetch');
268-
```
254+
## node.js (JavaScript, fetch)
269255

270-
-Run the code:
256+
### 1. Install Node.js:
257+
Ensure Node.js and npm are installed. Verify by running:
271258

272259
```bash
273-
node fetch_example.js
260+
node --version
261+
npm --version
274262
```
275263

276-
## node.js (JavaScript, axios)
277-
278-
macOS, Linux, and Windows:
279-
### 1.Install Node.js:
280-
-Follow the installation steps above.
264+
If not, download from Node.js **[Official Website]((https://nodejs.org/en))**.
281265

282-
### 2.Set Up a New Project:
283-
-Create a new project directory:
284-
285-
```bash
286-
mkdir node-axios-example
287-
cd node-axios-example
288-
```
289-
290-
-Initialize the project:
266+
Initialize a new Node.js project:
291267

292268
```bash
293269
npm init -y
294270
```
295271

296-
### 3.Install Axios:
272+
If using Node.js 18 or newer, the Fetch API is already built-in.
297273

298-
-Install the Axios library:
274+
For older versions, install the `node-fetch` package:
299275

300276
```bash
301-
npm install axios
302-
```
303-
304-
### 4.Create and Run the Code:
305-
306-
-Save the generated code in a file(` e.g., app.js`).
307-
-Run the code:
308-
309-
```bash
310-
node app.js
277+
npm install node-fetch
311278
```
312279

313-
## node.js (JavaScript, fetch)
314-
315-
macOS, Linux, and Windows:
316-
### 1. Install Node.js:
317-
-Follow the installation steps above.
318-
319280
### 2. Set Up a New Project:
320281
Create a project directory:
321282

@@ -324,29 +285,21 @@ mkdir node-fetch-example
324285
cd node-fetch-example
325286
```
326287

327-
### 3.Initialize the project:
288+
Initialize the project:
328289

329290
```bash
330291
npm init -y
331292
```
332293

333-
### 4.Ensure Fetch API Support:
334-
-If using Node.js 18 or newer, the Fetch API is already built-in.
335-
-For older versions, install the `node-fetch` package:
336-
337-
```bash
338-
npm install node-fetch
339-
```
340-
341-
### 5.Create and Run the Code:
342-
-Save the generated code in a file( `e.g., app.js`).
343-
-If using `node-fetch`, add the following line to the top of the file:
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:
344297

345298
```javascript
346299
const fetch = require('node-fetch');
347300
```
348301

349-
-Run the file:
302+
Run the file:
350303

351304
```bash
352305
node app.js

0 commit comments

Comments
 (0)