@@ -205,11 +205,105 @@ TODO
205
205
206
206
# # node.js (JavaScript, axios)
207
207
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
+ ` ` `
209
253
210
254
# # node.js (JavaScript, fetch)
211
255
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
+ ` ` `
213
307
214
308
# # Java (asynchttpclient)
215
309
0 commit comments