Questions tagged [node.js]
Node.js is an event-based, non-blocking, asynchronous I/O runtime that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the re-usability of code and the lack of context switching.
Im building an electron app where there is a main html file with a menu that has a few buttons. When each button is clicked it will load a local html file into an iframe. Inside the html files being ...
What I am trying to do is essentially this but in javascript & node.js
I am trying to get data from my express server using the fetch api. When I do this, i get an object error in return. Does anyone have any ideas on how to fix this?
This is my express code:
let express ...
Currently, the data below is returning payments, pending, and inactive at the end of the code as seen. As you can see each data set is returning different values. I want to restructure the way I am ...
So I'm using the Node.js Gmail library to send an email to another user. I was thinking of using a Service account to do just that. I've followed their documentation of passing the keyFile property ...
My problem is that I want to use firebase and what is mentioned in the title appears. attached code
import {initializeApp} from "firebase/app";
const firebaseConfig={
apiKey: "...
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'clone'
Require stack:
/Users/linnaishierhuachuan/Desktop/workspace/dev/cale-web/node_modules/_defaults@1.0.3@defaults/...
I am new to javascript and trying to build a chatbot. I want to give user limited options that they can pick from. ref link = https://www.chatbot.com/
question: How can i link these questions and ...
How do I call a mutation from another mutation within the same resolver in TypeORM if the function requires context as an argument?
Something like:
@Mutation()
async addNote(
@Ctx() { req }: ...
I have this large function. Please be patient through reading this, my variable names are terrible, unfortunately, but you should get the gist of it.
//running cronJob every 45 seconds on the ...
I build my whole project, but when I'm doing yarn build, I'm getting this error from yarn i.e.
Parse error on line 1:
^
Expecting "CALC", "LPAREN", "ADD", "SUB"...
I have this function. Apologies in advance for the terrible variable names.
//running cronJob every 45 seconds on the minute
var getTexts = new cronJob( '45 * * * * *', function(){
let weekday ...
We're using Middy as a wrapper with all our lambdas to deal with some logging and instrumentation logic, which is great.
We also use LaunchDarkly (launchdarkly-node-server-sdk) to access feature flags ...
I've set up some logic to run on a page but instead of console.logging the results, I'd like to send them to my database. Here's the script:
const cookies = document.cookie //https://www.youtube.com/...
I'm trying to install node-sass and nodemon with the command npm install -D node-sass nodemon but i get the following error:
error code ENOENT
error syscall spawn C:\ProgramData\Microsoft\Windows\...
I am trying to create a Task in a Google Cloud Tasks Queue from a firebase function that calls when an entry in a firebase Realtime Database is created. However when the function is supposed to create ...
Before I begin, I would like to say that, yes, this question appears to be identical to this one. The difference is that this is in repl.it node.js, so the solution to that question doesn't work here.
...
I was sending data from client side to server side using express and ajax and the transfer proccess works fine. The problem is i am tring to log the data to a .txt file after getting it but when i ...
I have a table called clients, in which i am trying to insert a new row.
The insert query is like so:
var addclient = "insert into clients (NAME, EMAIL, PHONE_NUMBER, TRAINER_NAME, 1, 2, 3, 4,...
I'm trying to connect to wss://csgoexo.com/socket.io/ using socket.io-client@2.4.0 or WS with node js. I really don't understand what I'm doing wrong. If I'm trying to connect from Chrome browser - it ...
I am planning to use Redis to store 1s or 0s in a variable length string, and toggle the bits by their offsets items over time.
Such as if I have set 0000010010001 using:
SETBIT draft1:888 5 1
SETBIT ...
asked 3 hours ago
fullstacklife
1,92033 gold badges1414 silver badges1313 bronze badges
I am trying to use Shepard.js for my web app.
I have installed the package using:
npm install shepherd.js --save
And I can see the folder in the node_modules folder in my web app's directory:
/Users/...
I have the following read/write nodejs application:
const readline = require('readline');
const readStream = process.stdin
const writeStream = process.stdout
const readInterface = readline....
asked 4 hours ago
Jeff Pal
1,09111 gold badge1212 silver badges1818 bronze badges
For some reason, the basic ping pong command isn't working. I copied and pasted it from a website, but I am not sure what is wrong with it.
const { Client, Intents } = require('discord.js');
const ...
If I have a string which something like this:
{
var1: '...',
func: () => {
console.log('hello: ', process.env['a-var']);
},
somethingElse: 'hello',
...
asked 4 hours ago
TheMan68
1,29322 gold badges2020 silver badges4343 bronze badges
this is the error message i am getting
TypeError: undefined is not an object (evaluating 'drinkList.drinks[0]')
can you help me please fix the error and give me some solution so that i can use the app ...
I'm currently trying to build a social media app and I'm setting up the navigation. Right now, when I yarn add some packages such as react-native-screens and react-native-reanimate, my project cannot ...
I am using the guide in discordjs.guide to have separate event listener files, and was trying to add another one. Specifically, the guildCreate event. In the index.js file, I have this:
const ...
I am making an application with sockets and the need arises to broadcast information, but only to people who are inside a room.
This is my code from the server.ts
// Dependencies
import express from '...
I have an issue and cannot resolve it by myself so asking for help. So I am going to implement sync request-reply pattern based on kafkajs. here is a short prototype: gist code
I am faced with the ...
I'm making an ecommerce website (for a portfolio project) and I was wondering if there were any examples on how to implement both Stripe and Paypal on a single website in Node.js. Unfortunately, I can'...
I have two lines in my charts.js graph. One is in scale from 1-10 and the other is 100 000-1 000 000 000. I would like to have them in one graph, not two, but not to show them in the same time because ...
asked 5 hours ago
Hrvoje T
2,33144 gold badges2323 silver badges3333 bronze badges
I want to download multiple pdf files from a site using Puppeteer.
The download starts by accessing a url that ends with .../download.
I am looping through an array of links and the first download ...
asked 5 hours ago
lennahht
8311 gold badge22 silver badges66 bronze badges
I'm gathering my cookies from a library as a string as the next one and I need to conver these to a tough-cookie container:
"b=a; Path=/; Expires=Mon, 01 Nov 2021 21:46:17 GMT, c=d; expires=Tue, ...
I am new to typescript and have a simple function to fetch values from the Postgres database. I need to test the method by mocking the database, I have tried various approaches provided but nothing of ...
asked 5 hours ago
Kashyap
32111 silver badge88 bronze badges
I struggle deploying my node.js(TS)/angular app with heroku.
When I try to deploy it on git with git push heroku master, every step go fine until the heroku-postbuild one.
Hence, it returns the ...
asked 5 hours ago
Denis Lebon
89911 gold badge44 silver badges88 bronze badges
This may be a very dumb question and I am not thinking, but how would one go about creating a like button, like Instagram. What I can't seem to figure out is how I would only allow the request if the ...
In the study, I got stuck at one point. Trying to check if a value exists in MongoDB db collection documents using Mongoose.
I have a separate function that searches for a DB entry using findOne.
If ...
I've created a topic in AWS SNS. Then I've created a subscription, in which an HTTP protocol is the endpoint .
I've written a simple script in express js to response to messages received from AWS-SNS....
I have been trying to implement a steam auth into my next.js web app and haven't been able to get it working.
Googling hasn't helped much.
I can authorise against the steam openid endpoint. ...
I run a react frontend application. I also serve an API in the backend. When I do "node server.js" it runs at port 5000 and then when I npm start it tries to run at port 5000 but as it is ...
I am creating a small app using NestJS and TypeORM and I am having trouble inserting into a table that has a composite foreign key.
Whenever the insert is executed, all columns get filled, except for ...
asked 6 hours ago
Felipe
4,45277 gold badges4040 silver badges6363 bronze badges
I'm still bad at ubuntu and encountering some problems with my node versions. I just uninstalled it with brew. In my vue project I have :
When I run node -v I get :
v10.19.0
If I run node -v out of ...
I am trying to store cryptocurrency balances into a table, some of which use 18 decimal places. In order to keep precision, I have to use the BigNumber Type from BigNumber.js, but when I set the ...
When the addIngredientsBtn is clicked, then the program is making a new textbox which is called ingredients in a new line, but I want to make that if I click on this button, then the program is making ...
I'm using node.js with typescript and I have a question
It is possible to remove properties that are not present in an interface when casting an object.
interface IFooReal {
prop1: ...
I am using the node.js package xlsx to access an xlsx file using the following code:
const XLSX = require("xlsx")
wbInput.addEventListener("change", (evt) => {
if (wbInput....
So, I am building an application using MongoDB as my Database. In my database exist 3 different schemas: Section, Category, and Product.
The schemas are defined as follows:
let ProductSchema = new ...
I am trying to build static sites with svelte-kit using static-adapter, but when I try to build a project the build process end with error showing that md-parser is not present. I am using this parser ...
In the code below:
The client is supposed to start emitting images as long Base64 Strings to the server, one after another at close intervals.
As soon as the first emit with a Base64 String takes ...
asked 7 hours ago
Sprout Coder
3,07099 gold badges3030 silver badges5252 bronze badges