Skip to content

Tag: node.js

Unable to push string into array

I am trying to learn EJS and make a blog but I cant seem to understand this error What I am trying to do is try to write some db response as an Object to an array then push it to the file. I am using replit DB Error that I am getting when I run the code: Answer First,

Variable of function always returns undefined

The idea: I want to return a variable from a function and then output it using console.log(). The problem: I can’t just use return result because then nothing is returned. I don`t really know how else to return the variable. I have already looked at SO posts like this one, however I probably lack suitab…

how to replace partial content of JS object array

I have a JS object array as : I’m saving the objects that are (Left) & (Right) to a new array. What I cannot do is, I’m trying to replace the partial string of the remaining[] array. in this example , the results are is what I would like to do / the expected outcome is to have the opposite

How to verify a JWT signature using Node-jose

I am trying to use node-jose to verify signatures of my JWTs. I know the secret, but am having trouble converting this secret into a JWK used for the verification. Here is an example of how I am trying to create my key with my secret and verify my token. This results in Error: no key found. Do I need

Calling external function from async.waterfall

I’m somewhat new to JS and working with an existing forked library (which is very complicated and poorly documented) – so please bear with me. I’m working on a mining pool system, and specifically adding a feature where users can set a custom payout amount instead of the lower pool limit. I&…