Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [node.js]

Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript engine. Node.js is commonly used for heavy client-server JavaScript applications.

Filter by
Sorted by
Tagged with
1 vote
0 answers
25 views

I've implemented a SvelteKit handleFetch hook that manages authentication for API requests with automatic token refresh. The API provides a 15-second grace period where a refresh token remains valid ...
tony's user avatar
  • 433
0 votes
0 answers
8 views

Title: Code Review Request: Mongoose Soft Delete Plugin with Query & Aggregate Middleware Body: I’ve implemented a soft delete plugin for Mongoose to handle REST API data safely in a MENN stack ...
Owais Qureshi's user avatar
9 votes
2 answers
355 views

As a followup to my previous version, I decided to try make this more cross-platform. I considered several languages: C++ is pretty cross platform, Rust is gaining popularity (and the language used by ...
404 Name Not Found's user avatar
8 votes
2 answers
301 views

On Arch Linux, there are 2 packages that provide the Rust toolchain: rust itself and rustup. When users try to install a package ...
404 Name Not Found's user avatar
2 votes
1 answer
68 views

I am writing a discord bot that can start and stop my minecraft server. It currently works, but I am still learning NodeJS and I could use some tips on how to optimize my code. Calling a command will ...
LitWaffle's user avatar
5 votes
0 answers
104 views

I recently did a quick take-home test for a potential job opportunity. It included building a GraphQL API with nodeJS. I am not an expert in node (mostly use Python at work) but I have used it for ...
Sajomancer's user avatar
3 votes
1 answer
258 views

I have built a Node.js program called serverserver, and it creates a server that you can access remotely on your phone. When you start the program, it prompts you to visit your public IP address. You ...
Cannabijoy's user avatar
3 votes
1 answer
73 views

I'm working on a migration script for surrealdb (currently working with 1.x). Please review and let me know what I should improve. ...
chovy's user avatar
  • 209
2 votes
0 answers
60 views

We need to implement a simple redaction function to redact (set to undefined) certain JSON elements when logging the JSON. The requirements are: We can't modify the current JSON object, as that ...
lincolnadym's user avatar
1 vote
1 answer
63 views

I'm working on a Next.js app and looking at the best way to structure database access. With Next.js and web based apps in general, there are lots of different "server actions", aka, API ...
Will Calderwood's user avatar
1 vote
1 answer
132 views

I have a huge list of 4k+ software products. My goal is simple. I have a list of products. Each of those products has a software value. I would like to extract each software occurrence and covert it ...
Fpasquer's user avatar
  • 113
2 votes
0 answers
107 views

The working code in full is here. It's a To-Do App with a TypeScript backend, written as practice for an upcoming 4-hour interview for a TypeScript backend role. My colleague and I would like to know, ...
Andrew Cheong's user avatar
1 vote
0 answers
57 views

I have a Node.js logging library that applies ANSI styling for text formatting. Currently, the code contains some redundancy and could be refactored for better readability. I'm particularly interested ...
Dinesh Basnet's user avatar
1 vote
1 answer
78 views

I needed to update a class in Node.js that parses the response from a new weather API endpoint but still preserves the same object structure and key values from having been using the old weather API ...
Aaron Goldsmith's user avatar
3 votes
1 answer
135 views

I think the only big improvement that can be made is to check which shard to query based on the userIds of the followed users. One easy way is to check the last ...
user avatar
0 votes
1 answer
63 views

I am refactoring an old project, made in Nodejs with Express, applying the MVC pattern, today it is a fairly simple project: handling of the FCM and Remote Config tools from Firebase. Would it be ...
JRR's user avatar
  • 39
1 vote
1 answer
100 views

I'm a DIY "dev" - so I really create things that I need or think they'll end up helping others. I wrote this Swift Package so the iOS community could get device bezel radius' to help with UI ...
markb's user avatar
  • 171
2 votes
2 answers
274 views

I am working on a MERN stack app that is a CRM with a couple of modules. Now when the user sends x request to the server to do a supposed action (such as delete something), the server first checks if ...
Syed M. Sannan's user avatar
0 votes
1 answer
69 views

I am building a template engine for js and I need some help refactoring the code for fast and more efficient performance. If you can help modify or suggest some updates I'll be grateful. ...
ahmed qoreichi's user avatar
2 votes
1 answer
113 views

I'm currently learning Express.js and I wrote this authentication code. I'm unsure if what i have is correct, how to improve it and if it's secure. For user and session data storage I'm using ...
Krneki123's user avatar
1 vote
0 answers
52 views

A personal project I'm working on needs Worker (thread) pool. The libraries I looked at were too high-level for my needs, as I simply needed access to the Worker itself while the libraries offered ...
Slava Knyazev's user avatar
2 votes
1 answer
108 views

I am using puppeteer to extract data and see when a car that meets my requirements shows up, this is what I did so far. I would like some basic syntax advice, or more advanced tips as well. I tried to ...
Mah Neh's user avatar
  • 79
1 vote
2 answers
100 views

I need/want to extend created array instance, to add extra methods that i see as useful. class.labels.js ...
Marc's user avatar
  • 153
0 votes
1 answer
163 views

The website TryHackMe came up with a challenge that involves using HTTP requests to interface with REST APIs (here, task #14/day 9). The challenge basically involves querying a basic REST API to ...
Aleksey's user avatar
  • 173
5 votes
1 answer
95 views

I built a basic authentication system for a node application and I have some security concerns. The username and password the user enters when they log in are stored as plaintext using express-...
HDawG's user avatar
  • 53
2 votes
1 answer
200 views

Description This javascript code uses tmi.js to listen for chat messages in a Twitch chat and perform certain actions depending on their content. In the sample code ...
Patrick Christie's user avatar
-2 votes
1 answer
83 views

I have this NodeJS code which I need to Reduce complexity and making it more readable coz it has to many repeatable loops, and the api is very slow how do i fix this. ...
Prajwal K Rao's user avatar
3 votes
1 answer
171 views

Kattis problem - ("I've been everywhere") I would highly recommend looking at the problem through the link, however I will summarize it a bit here and explain the functionality of each part ...
doroshm's user avatar
  • 33
3 votes
1 answer
66 views

I had to implement the below as a coding challenge. There are two http endpoints. The first http endpoints returns a list of postcodes. The second http endpoint takes a postcode as a parameter and ...
hulike2286's user avatar
2 votes
2 answers
166 views

I have to identify added and deleted items between two objects with the same structure. ...
Elias Bobadilla's user avatar
0 votes
1 answer
75 views

The question is about nodejs module pattern code structure. My goal is to initialise the module at one time and export the module using module.export so that, it's ...
Sreejith sreeji's user avatar
1 vote
1 answer
80 views

Im new at backend development and I'm noticing that my code is very messy and difficult to read. I know this doesn't have a single correct answer but id like to know how I can make my code tidier when ...
guido's user avatar
  • 13
1 vote
1 answer
134 views

I am writing a resolver for a typical updateUser mutation with node, Apollo Server and mongoDB. I want to make it such that, when the ...
user8758206's user avatar
4 votes
1 answer
145 views

I'm a freshman student. What does my program solve? This is actually a bot for reddit, and there are language learning subreddits on that website, sometimes when discussing something with people, we ...
user9560064's user avatar
4 votes
1 answer
1k views

Here is the solution that I have. Due to the legacy product we have all of our URLs in one big Slug model in rails that maps URLs to models. EG ...
Romuloux's user avatar
0 votes
0 answers
2k views

Batch processing steps: When a job is posted, push it to the queue. Get the required number of items from the queue and put it in the ...
sg7610's user avatar
  • 388
2 votes
1 answer
80 views

I am a newbie js "developer" and for practice, I created a tiny (8 methods) JavaScript library. I need you to give me feedback "should I keep expanding my library or switch to something ...
delaklo's user avatar
  • 23
0 votes
1 answer
121 views

I'm coding a simple websocket chat app. I was wondering if my code is secure and efficient. I also have a question about the way how I'm sending objects and then checking the type, is there anything ...
MousTea's user avatar
  • 31
0 votes
1 answer
624 views

I'm writing a Discord bot that sometimes requires a Minecraft account UUID to be looked up so this is the function (and MWE) I have written to do this. ...
Jake's user avatar
  • 131
2 votes
1 answer
137 views

I am building a basic authentication system with a node backend and wonder whether I am using the try-catch block excessively. I have this example controller: ...
user8758206's user avatar
1 vote
1 answer
253 views

The structure of the JSON is as such: Each parent record can have many DataGroups and each DataGroup can have many ...
Faahmed's user avatar
  • 113
3 votes
1 answer
236 views

Is there a way to beautify my code? It works but there repeated blocks and I am not sure that I'm using some functions in the right way. I'm not new to JavaScript but I want to improve it and get rid ...
Denis Cherepanov's user avatar
2 votes
0 answers
722 views

I've been working on this game the last 2 days. The game is working but I need a feedback for my code. Can it be made simpler? Sorry if my code is very complicated or not well written: I am in the ...
Cristoforos choras's user avatar
1 vote
1 answer
3k views

I want to process a file chunk by chunk to prevent memory exhaustion. I need to consume the file using a read stream. When trying it, this implementation seems to work fine. I am asking your expert ...
Louis Coulet's user avatar
0 votes
1 answer
141 views

So basically my question is what would be a better way to achieve my goal? The code below works fine but looks like it is extremely inefficient and could be achieved in a better way. The code ...
WoJo's user avatar
  • 103
1 vote
1 answer
132 views

I am learning JavaScript and decided to translate my Python scripts into JavaScript. Approximations of π are extremely popular programming challenges and I am sure they must be a staple of the ...
Ξένη Γήινος's user avatar
1 vote
1 answer
258 views

Generalizations of Fibonacci numbers Fibonacci numbers of higher order A Fibonacci sequence of order \$n\$ is an integer sequence in which each sequence element is the sum of the previous \$n\$ ...
Ξένη Γήινος's user avatar
3 votes
1 answer
177 views

This is a simple JavaScript function that does prime factorization. I wrote it on an Android phone with online editor (I don't have access to computers in night time): Code: ...
Ξένη Γήινος's user avatar
2 votes
2 answers
1k views

I had just decided to learn JavaScript, so I wrote this program. I am sure you know what FizzBuzz is so I wouldn't describe it here. Console output: ...
Ξένη Γήινος's user avatar
3 votes
0 answers
202 views

I'm coding a simple websocket chat app. I was wondering if my code is secure and efficient. I also have a question about the way how I'm sending objects and then checking the type, is there anything ...
MousTea's user avatar
  • 31

1
2 3 4 5
19