Skip to content
Advertisement

Tag: node.js

What makes the requests/functions in Javascript asynchronous?

When you make a request to an API, the operation is usually asynchronous. I am wondering what actually makes these API requests asynchronous? Is it because we send the requests asynchronously(like using .then() function or async/await for promise) or the API server handles our requests asynchronously? I think it should be the former one? Besides, why some functions can be

How to store response body in supertest?

I am testing very basic REST api with supertest. I want to save the item id received in response body and assign it to a variable. Using this id i want to make further tests like get-item-by-id or update-item-by-id. No official documentation has covered this so a beginner friendly answer would be very helpful. test i have written Answer Use

Nodejs how to create a `data tree` with array on result

How to fix or redesign results or create a TreeView after mapping the result using nodejs? this is my code, please check below the desired result What I want here is that if the QuestionGroupID is existing it will not create another row but it will create array on optionItems please see the desired result vs current result to understand

How do I send a sticker in Discord.js

I can’t figure out how to send a sticker in discord.js. Here is my code (ids removed): And when trying that I get this error: But if I just try stickers: client.guilds.cache.get(‘guild id’).stickers.cache it works but instead sends every sticker in the server Does anyone know what this error means, how to fix it, and if there is just a

Can’t persist checkstate in reactjs and nodejs

This would be my first time of doing this and I can’t seem to find a way around it. I would like to persist check box state in react.js and would like this to be done without my MongoDB database. Here are my codes so far: I am fetching list of subscribers from my MongoDB database like this: This displays

Advertisement