Category "node.js"

How to read the .ts configuration file from the root of the project in the npm package (ESM)

How can I read the configuration file (e.g. mypkg.config.ts) from the root of the project in my npm module built on ESM? I found this, and figured out how to do

Downloading JSON file in expressjs and reading it

I have a task where I am given a URL such as https://xyz.json. This URL prompts the downloading of the JSON file into the local. I am now required to read the u

How to add ObjectId only if the ObjectID is not present in the array in mongodb using mongoose?

so I have a schema where I want to add ObjectID to an array of id's in mongoose, I tried adding it unique, but did not work. Most likely because I need to itera

Get interaction's reponse message object discord.js

Si I have this really simple command : let row = new Discord.MessageActionRow().addComponents(...) // The .. is too long so i'll just remove it for this questio

Multer super slow upload after recieving post request with images

Hello I'm on a (ReactJs Node Mysql Express) stack, my website has an events tab which the admin could upload to it events. Each event has a cover photo, inner p

Multer super slow upload after recieving post request with images

Hello I'm on a (ReactJs Node Mysql Express) stack, my website has an events tab which the admin could upload to it events. Each event has a cover photo, inner p

2 x criteria for Match showing no results

I am trying to show results where the sum of records is greater or equal to 4 and the status matches a string. If I leave off the status field it works fine but

Node.js Postgresql problem querying database using 'pg' module

I'm trying to insert data into a 'users' table inside a postgresql database using the 'pg' NPM module. But when I make a POST request, the transaction executes

Object passed by server cannot see the function in a class

I am passing an object from server and I cannot see it pass functions. here is my code. const express = require('express'); const app = express(); const path =

How to get data from one controller by calling it from another controllers in Express without circular dependencies?

I am building an API using express js. I have structured it so that each data model (e.g. user, organization, etc.) has their own modules as such: router - vali

How do I read an uploaded file (text/.csv) using nestjs and Multer

I need to read my CSV file in the controller to add CSV file data into my DB. But I don't know the way to that. I search for an answer so many times but I can't

WOPI : File content is not displaying in DOC Viewer

I have implemented WOPI in my Vue.js app and implemented a GET API in Node.js to return the file content, still iam unable to see the content in DOC viewer in f

node js saving all values as 0 in sql

Im making an API on nodejs with express and mysql. In the POST method i dont get any error but on mysql store al values as 0, like this: 1 0 0.00 0000-00-00 0

vue + vite + ubuntu 20 bugs

I'm very confused. I just saved my code to github from windows, where the vue.js app compiles successfully. But when opening exactly the same code in ubuntu, wi

nodejs oracledb performance diff by the way of binding params

I wonder if there is a performance difference between below cases. nodejs oracledb lib - express server connection code - 1 query, 1 connection whenever I send

Electron-log with file transport is forcing app reload

I am using the electron-todo template and trying to create a log file that recovers the data in the event of a crash. The app reloads every time the log file is

what is the equivalent of Java's System.out.print() in javascript [duplicate]

It seems console.log() is the equivalent of System.out.println() How to print strings in the same line with multiple calls? Like: for (let i=0

socket.io doesn't send message back to socket

i'm working on an app which communicate with server via socket.io, users in my app have unique ids which i want to use on my server so i made a small class whic

Stripe didn't create invoices

According to stripe's dashboard (test mode), customer's next subscription invoice should have been created on April 28th at 5AM but it's April 29th today and th

node.sass not compiling index.scss file with variables

I'm trying to get node-sass to compile the following index.scss file. The error returned has to do with a call in bootstrap.scss file within node_modules. @imp