All Questions
18 questions
2
votes
1
answer
115
views
Basic node login routes for authentication system
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:
...
1
vote
1
answer
3k
views
Process a binary file by chunk using a read stream in nodejs
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 ...
4
votes
1
answer
163
views
Catching Errors in Factory Method with express.js
My express.js application uses a lot of promises for interacting with a variety of services. Instead of including try/catch with each one, I've setup a fail safe factory method for all my express ...
3
votes
2
answers
425
views
Improving Async/Await Javascript Code
I'm working on a data analytics dashboard in Node.js as a portfolio piece. I've built a pipeline that gets the data where it needs to be for more processing, however, I feel the below code can be ...
3
votes
0
answers
420
views
Mern stack app on error handling, async await, try-catch and avoiding DRY in controller functions
I'm looking for a review of my backend code on how to keep it more DRY. I see a lot of repetition in validation part of email and password, also I need some advice on if I have used the try-catch and ...
0
votes
1
answer
60
views
Registering a user and login
I have these following controller functions for registering a user and login, in my app, and I want to make it more clean and maintainable.
Probably by using ...
2
votes
0
answers
44
views
Passing JSON files through an API - node async
I am writing a small program which reads some JSON files, passes the content to an API, then saves the response in some more JSON files. A pretty simple task, and the code works fine, but I have been ...
4
votes
1
answer
376
views
Data encryption / decryption on Node.js
I've implemented my first data encryption / decryption methods on Node.js.
Although it might look similar to hundreds of sample implementations available online, I'm curious to get a feedback.
I'm ...
3
votes
0
answers
672
views
Example Multiple Async Await Calls Javascript
I need to make an unknown number of api calls, up to 5 max probably. But most samples I've seen show only a couple of async calls so are effectively hard coded to the number of calls being made.
This ...
3
votes
1
answer
444
views
Separating Fetch Calls and using in Promise Chain
I´m currently working on a small microservice application, which will in it´s simplest form just receive a Request from a Formular and and based on containing information perform several other Server-...
3
votes
1
answer
61
views
JavaScript that deletes everything inside a folder on Box.com
I just finished a simple script for Node that will delete all the folders and files inside a specified folder ID through Box's API. It works by getting a list of items inside a folder, then generating ...
0
votes
1
answer
132
views
#Error Handling- Propagating errors to calling function.
Im new to javascript programming and i am required to make a web app. Node.js will be used as the js runtime environment. In order to minimize the amount of time needed for debugging as the app ...
4
votes
1
answer
442
views
CLI to bump package.json version and add git tags
I'm writing a command line app in node.js. At this stage, the app does the following:
Get the version from package.json
Update the package.json with a new version ...
2
votes
0
answers
876
views
Async/await Mysql wrapper
I used MySQL, but it was inconvenient so I made a wrapper.
It works, but I'm unsure if there are any issues.
Used node module - mysql2, bluebird
sqlWarpper.js
...
-2
votes
1
answer
54
views
Convert this method into parallel await [closed]
I am using Node.js. I have two different classes. The first one is called Controller, the second is called ServerCommunicator. Controller calls a method in SC (sendDataToDolibarrAsync), which takes a ...