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.
919 questions
-3
votes
0
answers
41
views
Websocket integration for High frequency trading [closed]
I’m currently building a trading platform that requires streaming real-time price updates to the UI. I’ve implemented a WebSocket gateway and added handling for common issues such as:
Ghost/...
1
vote
0
answers
29
views
SvelteKit authentication hook with token refresh and request deduplication
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 ...
6
votes
2
answers
1k
views
Shorten my asynchronous DB queries, using async.js module
I am using the following frameworks/libraries:
Node.js
Express.js
node-mysql.js
async.js
I am making multiple asynchronous queries to my DB, but each subsequent query relies on the results of the ...
5
votes
0
answers
104
views
Correct abstractions/organisation of a NodeJS GraphQL API
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 ...
0
votes
0
answers
8
views
SafeDelete for Mongodb plugin
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 ...
2
votes
1
answer
70
views
NodeJS discord bot that starts systemd services
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 ...
8
votes
2
answers
303
views
Simple Node.js version manager
On Arch Linux, there are 2 packages that provide the Rust toolchain: rust itself and rustup. When users try to install a package ...
9
votes
2
answers
356
views
Simple Node.js version manager v2
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 ...
6
votes
0
answers
134
views
Showing a Wikipedia article's changes as Git commits
I created a small-ish NodeJS script which takes as argument the name of a Wikipedia article (and optionally a Wikipedia edition, "en" is default) and creates a Git repository with each ...
7
votes
1
answer
634
views
nodejs 401 request retry mechanism
I'm working on a project in which I have a backend in nodejs and from there I need to call external APIs, those APIs require authentication token which is valid for 15 minutes. So if response status ...
3
votes
1
answer
258
views
A home server template to securely access personal apps
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 ...
10
votes
2
answers
336
views
JSON4 parser in Typescript
Context
I may have accidentally gotten a little sidetracked during homeschooling, and wrote a JSON4 parser in Typescript during the down-time. This project started as an idea that I got while ...
5
votes
1
answer
93
views
Browser and Node.js compatible code require
The Reason
The reason I designed this code was that in many cases, when I wanted to test code in the browser that would be running on a Node instance, the code that I was copying (Don't worry, copying ...
3
votes
1
answer
73
views
My surrealdb (1.x) migration script
I'm working on a migration script for surrealdb (currently working with 1.x).
Please review and let me know what I should improve.
...
2
votes
0
answers
60
views
Redact specific elements from JSON (for logging)
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 ...