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 the server side and therefore benefit from the re-usability of code and the lack of context switching.
node.js
9
questions with bounties
2
votes
1
answer
57
views
+50
Problem when requiring packages bundled with webpack
I'm able to use libraries with node like:
const API = require("api");
const Service = require("service");
however, when I bundle the js file with webpack, it doesn't work and I ...
-2
votes
1
answer
32
views
+100
Match a partial object with node:assert / assert arguments of mocked function
I have a mock and want to make sure that it was called with a specific set of arguments. However, I do not want to loop through all calls first.
it("should assert args", (t) => {
const ...
1
vote
0
answers
36
views
+50
next.js n-api module: module parse failed unexpected character
I have created a node module following this recipe:
mkdir addon
cd addon
npm init -y
npm install --save-dev node-gyp
npm install node-addon-api
Create the file addon.cc:
#include <napi.h>
Napi::...
0
votes
1
answer
51
views
+300
Twilio - Push notifications fail in serverless production deployment
I have an Twilio programmable messaging app which is deployed in a Twilio serverless environment.
let response = new Twilio.Response();
exports.handler = async function(context, event, callback) {
...
-7
votes
0
answers
130
views
+500
How to properly handle internal/external API errors in service-, data- & app layers in Next.js? [closed]
I'm building a Next application with the following layers:
lib/service (async server-only functions doing a fetch from an external api and returning the data)
data (async server-only functions that ...
1
vote
0
answers
217
views
+200
How to containerize a single node app from a mono-repo that utilizes npm workspaces
I have a mono-repo with 4 node packages:
/
└── apps
├── app1 ( "dependencies": { "lib1": "../../libs/lib1" } )
└── app2 ( "dependencies": { "lib2&...
-1
votes
0
answers
67
views
+100
How to call a binary with execFile() multiple times in parallel?
I'm using execFile and execFileSync to invoke a CLI tool called rad from inside my Node.js app. Specifically, I need to call it once to retrieve a list of "Patch" IDs in a "Repo" ...
0
votes
0
answers
60
views
+50
Writing/Reading to the same file when increasing pm2 replicas
I have a bull queue implemented in Redis, which accepts data in this format
{
sessionID : '43i43ko4'
events : [{...}]
}
This data are being sent as queue and then I process them in consumer.js. ...
0
votes
0
answers
32
views
+100
auth 2.0 from Microsoft not redirecting to call back url after successful permission accept
I have the following NodeJS code
async onedrive (
addon: AddOn,
app: express.Application,
req: any,
res: any
) {
const storageType = req.query.storageType; // Get the selected ...