Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

How to handle an error thrown by an asynchronous function? [duplicate]

This is not a duplicate to this question since it discusses rejecting promises. This is about errors that are thrown. It is also worth mentioning that I can't modify the behavior of the mpv....
Omaro_IB's user avatar
  • 435
0 votes
1 answer
195 views

(TS 2556) Why am I recieving a type error on a spread argument that has already been explicitly typed and passed as a rest parameter?

function debouncePromise<TParams extends Array<unknown>, TRes>( fn: (a: TParams) => Promise<TRes>, time: number, ) { let timerId: ReturnType<typeof setTimeout> | ...
tem's user avatar
  • 43
1 vote
0 answers
107 views

Append file's content to the new file is not working

I have a folder with 4 files with CSS styles. Using Node.js modules tried to create a new file 'bundle.css' and append content of these 4 files with style (css). But the code instead of styles, return:...
codingForCode's user avatar
0 votes
1 answer
157 views

Node JS Async function not working as expected

I am using NodeJS 18 version, and I am trying to paginate the dynamo DB results using the async function, but it is not giving me any results. My dynamo DB table has the data. I am using the dynamo db ...
Aravindan vaithialingam's user avatar
0 votes
0 answers
28 views

mongodb client nodejs check if database exist else run "async.each" to create collection

Hello I got a problem that mongodb client try to check if collection exist or not Here is the connect function: const { MongoClient } = require("mongodb"); const async = require("async&...
RageOfFire's user avatar
0 votes
1 answer
55 views

Cant access main parents callback function inside mongo query | cb is not a function

I am working with mongodb in sails js. we are using async.auto from async.js. I am creating a new mongo connection for few reasons and firing find query to get the data, after retrieving data from db ...
Abhishek Kokate's user avatar
0 votes
1 answer
453 views

Is there a way to detect if the method inside the decorator is async or not - JS [duplicate]

I looking for a way to detect if my function inside the decorator is async or not. function catchError(target: any, propertyName: string, descriptor: PropertyDescriptor) { const method = ...
elija's user avatar
  • 21
0 votes
1 answer
42 views

Node.js write object propertys in same time via socket.io

In Node.js, can it happen that when different properties of a global object are written at the same time (with a socket.io request), one of the properties retains its original value? ` var rooms = { ...
HU TanKy's user avatar
0 votes
0 answers
106 views

NodeJs parallel request in a loop too slow

so I have this feature that I am working on that takes an object (Over 10k items) picks an item from this object, sends it to an api, which process it then give a response, then proceeds to the next ...
vhiktordom's user avatar
0 votes
1 answer
199 views

Async Queue Library, Pass variables to callback

I'm using the async library to create a queue. My code for my queue looks something like this. const async = require('async'); const db = require('../models'); const logger = require('../logger'); var ...
Joseph Astrahan's user avatar
0 votes
1 answer
281 views

Node.js on multi-core machines for file I/O operations

I'm a bit confused because all the examples I read about Node cluster module only seem to apply to webservers and concurrent requests. Otherwise to CPU intensive application it is recommended to use ...
Jo?o Pimentel Ferreira's user avatar
0 votes
1 answer
119 views

how to correctly return data from async function node js, jest error

I have a function something like that: async function example(){ let data = await another_function(); var ws = fs.createWriteStream('path'); let jsonData = [{'id':'1234', 'name': 'Alex'}]; fastcsv ...
Bimbo's user avatar
  • 69
1 vote
0 answers
68 views

i have converted excel data into json using npm library convert-excel-to-json but now I have to use async.eachSeries to insert data into mongoDb ,how?

/* I have to use async.eachSeries to insert and validate duplicate data but the library is returning array of objects ,How can I do it Can anyone help */ app.post("/",upload.single(&...
Ayyan Shaikh's user avatar
0 votes
0 answers
1k views

Async/Await promise being called twice

I'm trying to check if a connection exists after attempting to delete it. At this point the connection has already been deleted and it is now about to start checking once every second for 10 seconds. ...
akremer's user avatar
  • 125
2 votes
0 answers
148 views

Unhandled promise rejection when executing file using node

I am trying to run a cron job on Heroku which runs daily. The node version this Heroku server/project uses is v9.4. I am also using the async package v2.6.1 When I run the file using node: node dist/...
iamconfusion's user avatar

15 30 50 per page
1
2 3 4 5
62