So, I am pretty new to Electron and wanted to build a desktop application. But I have been running into issues, particularly in getting the renderer and main processes to communicate. I am aware of the IPC and remote concepts and this about me not being able to use them in the first place. I have tried to sur…
Tag: node.js
API Key does not start with “SG.” SendGrid
I am trying to set up SendGrid add-on in my Heroku NodeJS app. I created the API Key and set it as an environment variable. The whole API key looks something like: SG.actualValue.bbb_cccccc The first setup I did I set the whole key as as my SENDGRID_API_KEY and I got this error: API key does not start with SG…
Google Sheets API v4 write data
I am trying to write data to a Google Sheet using the Nodejs API v4. I can sucessfully read and clear data, so I have set everything up correctly. However, using the example in the docs here for the update method, I cannot work out how to specify the data I want to put in the Google sheet. I would
How to build an odata service in node by json service
We have a requirement of reading the service and convert it into odata. Our target system only understands odata and the source cannot deliver odata. So we are trying to build node service to facilitate the same. I tried to use CAP (https://cap.cloud.sap/docs/get-started/) but it seems it can only work with p…
How to format datetime in EJS?
enter image description here I am trying to achieve the datetime format like this 1:00 am May 11 2020? I am using mongoDB and EJS How can I do it in my code? Here is my server.js code: And here’s my EJS template: How can can I achieve that format in my code??????????? I appreciate all the answers thank …
Express APP how to redirect user to /:id path from server side
I’m learning Node.js and I’m finding some troubles with redirecting the user to an :id path. I would like to print there his username. So to make an overview it is a landing page with a form where I ask for an Alias and an email. When user clicks submit I’d like to move him to /:id path to p…
Trouble installing Swiper in my React project
I’m trying to add Swiper to my React Web App, I’m having trouble with the regular plugin, so I decided to use this framework instead: swiper-react specifically designed for React. Following the getting started tutorial: It says that I need to import these CSS files but when I try to import them in…
nodejs – replace a string everywhere in a large file
I have some huge files which are difficult to read in memory. I need to read each line and then replace double quotes if found and edit the same file. Right now, I am reading the file line by line, storing in an array and overwriting the same file. But, that’s giving memory issue for big files. Any poin…
Typescript compiler work but Javascript result is wrong
First of all, I want to show you my directory tree: I have tried to add types on my NodeJS project by adding Typescript. For that, I have installed many things into the root folder: npm i -D typescript npm i -D @types/node npm i -D @types/express See there the index.ts script into the dir1 folder: To test typ…
Why use readFileAsync to read file with json inside in Node.js?
I was learning Node.js and was watching Node.js course where an author used the below code: As you can see the code above, we first try to parse the json by reading the file synchronously. The author said that if we use const tours = JSON.parse(fs.readFileSync(‘data.json’)); inside callback of get…