Category "node.js"

How to Unit Test a method inside a module in NestJs (Jest)

I'm adding tests on a project and improving coverage. I would like to know how can I test a method defined inside a module definition in NestJs. import { Middle

Sending a signed transaction is not working - Web3 / Node.js

I am trying to send an Ethereum transaction using a private key in Node.js using the web3 library. I have tried many pieces of code but I get the same issues ev

How to update PATH environment variable while deploying in Cloud Foundry

I want to deploy my Node.js application in Pivotal Cloud Foundry using manifest.yml. I need to update the PATH variable of the container before the application

How to listen for messages from SQS in nodesJS?

I am trying to use SQS the same way we used RabbitMQ or Kafka where we set up a listener. But I dont see a way to setup a listener for SQS anywhere in their doc

DiscordJS v13 send to specific channel

So I am trying to send an embed to a different channel than the command was used in as a log channel how ever I have tried a few different methods however where

Jest Testing - mockReset does not clear the already set values

I have a lambda which calls an interface. Am trying to mock the functions imported from the interface. In each test case, I have to mock different values. When

How to join three (multipe) collections with $lookup in mongodb?

How to join three (multipe) collections with $lookup in mongodb? Hi I am looking to join data from three collection users collection: [ { _id:0, name:"abc", pho

Unable to create AWS CloudFormation stack

I am changing the Node version of my project to 14 and trying to custom deploy it to my staging environment for testing. But after changing the version to 14, I

listen EACCES: permission denied 127.0.0.1:80 - macOS

I need to serve an angular app with specific --host flag and --port 80. I added the host to my /etc/hosts file but when i use command "ng serve --host local.xxx

Node/Twilio multiple config variables in require function

I was wondering if any other people have managed to find a way to use multiple account sids and auth tokens when using Twilio for Node. The documentation is pre

how to set env in Sheel for node.js [closed]

shell:$ set CONF = 44 const mytext = process.env.CONF console.log(mytext); //undefined

Yarn workspaces monorepo with Firebase functions failed to initialize

I am trying to set up a monorepo that firebase functions will be able to require some shared logic from different directories - as for now I have a setup that w

Node TS, Build Generation Failed for Google Cloud Run, Giving Error Type 'IsTuple' not generic

I have Node ts Project and it is deployed on cloud run but while creating build it is giving below error. node_modules/@types/prettier/index.d.ts(41,54): error

NodeJs - Get last modified file in sub directories of directory

I have the following code to list all folders within a directory, and it maps each folder's name and date created. I'm struggling to get the last modified file

Unable to connect to the Postgres database in Docker Compose

I am building a Node JS Web application. I am using Postgres SQL and Sequelize for the database. I have the docker-compose.yaml with the following content.

Handle Notification Bidirectional Body Text in the Correct Way

I have a notification service that sends a notification to the client according to its language. The notification body language can be either Arabic or English.

How to manually extract context or span from incoming http request in NodeJS?

I trying to migrate my Node.js application from jaeger-client to @opentelemetry/* packages In my Node.js application i have a simple http server and i want to c

findOneAndUpdate. Select array of messages, select message object and update likes array inside it

I use mongoose findOneAndUpdate method, but could't achieve the result. I always get the same object back. No errors. Here's my code. User object: { "_id" :

Javascript - draw a rectangular selection on an image

I need some help to implement a feature in my vuejs capacitor app. I'm getting a snapshot from an ip cam every second and this will simulate a video stream sinc

NestJs e2e returns 201 created response though required form data is missing, expected 400 bad request

I'm trying to write a test that checks if request body does not have proper data, it should return an error, and the status code should be 400. Which I think is