Skip to content
Advertisement

Tag: express

How to access the into PUG passed object inside of an inline script without converting

Is it possible to access the whole object, which is passed into PUG, inside of an inline script without converting it with !{JSON.stringify(object)}; Using !{JSON.stringify(events)}; converts existing date-objects to strings, which than needs to be converted back. Wanted behavior: Answer Is it possible to access the whole object, wich is passed into PUG, inside of an inline script without converting

Get a value from a callback in another function NodeJS

I’m desperately trying to recover the value of a callback function but I have no idea how to do that. I have a function where I execute this code: Who performs this function: And which is called by this variable: I would like my `authentication’ variable to take the value returned in the callback, and I have no idea how

How to wait for new information from a node.js server

so i am making a small chat lobby project. But im having issues with getting the messages people are sending to the server, back to the clients to show them on the site. It kind of worked using a loop like this: However this is obviosly really bad, and if you started spamming, or too many clients joined, it overloaded

Advertisement