I’m working on a personal project and am trying to understand the process logic that keeps my Node JS process from terminating after calling populateTransactions(). I think its because I need to close the DB (I’m not entirely clear on why), but when I do, the process terminates but the save() func…
Tag: node.js
Get multiply key’value in object that have the same key
JSON data: I want loop that search for e.g. David’s texts and show it in HTML: I’m sorry for the bad expression but I don’t know how to explain this. Answer HTML Content JS Content
Cypress – how to properly wait for result of an imported JS function
I am new to Cypress (and naive to JS). I would like to write a JS library as a wrapper to 3rd party APIs. I write the API wrapper as an individual file (instead of using Cypress Custom functions) because I believe I can share the library with teams NOT using Cypress E2E tool. The problem I am facing is
Discord guilds.join OAuth2 in JS
I am making a bot for Discord (node.js) and I want to have it’s oauth2 so when the user adds the bot to their server and accepts the oauth app permissions, the user is automatically joined into my bot support server. I’ve seen https://dsc.gg do this, and I want to do something similar. How would I…
Ionic cordova add platform (Error: socket hang up)
I am creating an app with ionic framework. I created an API via a cheerio scrape afterwards and connected to heroku to make a Hattp call. the problem is that while adding the android platform i get a ‘socket hang up’ error. How can I go about solving the problem? Thank you in advance. This is my c…
How to use browser-side JavaScript (document, window, etc.) when running a node.js server to change the HTML document?
here’s my situation. I just started learning about node.js server with express and I find it to be an amazing technology, based on JavaScript that I am already a bit familiar with. Now, so far, whenever I want to change something on the page, I have to do it with JS on the server-side with node.js, and …
SyntaxError when using try/catch with aync/await in NodeJS [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 y…
Create and assign role Discord.js
I’m creating a Discord bot with discord.js, but I don’t find how to create a role and assign it automatically. Example, a client writes: ?insc NAME @pseudo1 @pseudo2 @pseudo3 This command create the role NAME, then a category with channelVoice and channelText with access only for NAME. For the mom…
JAVASCRIPT JSON.parse() return Unexpected end of JSON input
I have a response from a service, using https I need parse this response but… I know the final result should be(I get this with postman)… When I run JSON.parse(data) I get this errror “errorType”: “SyntaxError”, “errorMessage”: “Unexpected end of JSON inpu…
Get AWS S3 Upload URL – NodeJs AWS-SDK
I’m pretty sure I’m missing something very obvious here, but: I’m uploading a file to an s3 bucket using aws-sdk as follows: I’m able to log the upload url successfully, however the awsURL returned is an array, not the data.Location value – shouldn’t the data.Location be re…