Category "javascript"

createReadStream is not present in uploaded image

I am using node v14.17.0,"apollo-server-express": "^2.25.0", "graphql-upload": "^12.0.0" I am trying to upload an image but i dont get createReadStream from the

Can I read a text file from github repo from nodejs app?

I want to get data from a text file in someone's github repository. Can I do this using nodejs (like with the help of octokit.js by api calling).

When clicking on hyper links it gives a wrong result

I have a header with two elements that when links are clicked it should take me to two different URL's: <header ng-controller="myHeader"> <nav cla

Detect React/ReactDOM development/production build

React development build behaves differently than production build, e.g. error handling. It can be figured out which one is used from the environment but only i

Problems with React Scroll and scroll-snap-type

I'm trying to use scroll-snap-type: y proximity;, but it isn't working well with react-scroll. I find that the page is scrolling in HTML tag and when I set over

Avoiding Redos Attacks

Using regular expressions is a little bit tricky especially in Node.js applications. Because It can cause REDOS attacks. I thought that maybe running all regula

How to convert numbers to be a comma separated value in Klaviyo

I have these dynamics variables which has a number. I.E) 1, 10, 350, 1200 or 12500, etc. On Klaviyo I want to format these numbers to be comma separated if it'

JS addEventListener for "input" change made by code [duplicate]

I am writing a JS event listener to hide button if the entered value in a text field is true: const item = document.getElementById("my-field")

Javascript destroys Css font style (Linkedin Badge)

EDIT: i made a video to present the issue. Find it here: https://streamable.com/r8sl85 I am implementing my LinkedIn badge on my website. They provide me the co

JavaScript object assignment: unexpected behaviour

Suppose we have two objects: var a = { foo: { bar: 1 } } var b = { foo: { bar: 2 } } If I set the object b to a (a = b), I expect that a takes the value of b

Optimize the display value in React Js

Please let me know how I can optimize more below code in one line: {addressToDisplay?.addressLineOne} {addressToDisplay?.addressLineTwo} {addressTo

Username validation using regex

I am trying to validate the Username field in Vue using regex. I have a key down event on the textbox and on each key down the below method is called userNameVa

React Native text string must be rendered within a text

Hello the react native code below takes care of displaying a ui, when I run the code I get the following error? come I solve this? The text it indicates is alre

How to fix an extensive echoing while recording audio using navigator.mediaDevices.getUserMedia?

So, I am working on a small electron desktop app that captures desktop screen and records video and audio. When I am trying to add audio to the stream it starts

How to export to excel file from API

Have angular datatable and table contains more than 50k records, if we trying to export to excel taking lot of time and browser is not responding. If possible c

Cannot read property 'setProperty' of undefined fxFlex issue with ng-container Angular 9 Flex Layout

<div [fxLayout]="fields.layoutConfig.layoutDirection + ' wrap'" fxLayout.xs="column" [fxLayoutGap]="fields.layoutConfig.fxLayoutGap"> <ng-cont

Setting Apollo client header dynamically is not working

I am trying to set the header of Apollo client dynamically according to official doc, but I am getting an error: TypeError: (0 , _apollo.default) is not a

Can you call a Solidity contract method with only Metamask?

I’m wanting to use Metamask in my app to let users pay a fixed ETH fee (plus gas) to call a method from my Solidity contract. I looked at the Metamask doc

How can I have multiple functions in onkeyup?

I am writing code to be able to search multiple fields within cards that pull customer data from endpoints. The first function that searches customerID works fi

Retrieving a raw file URL from the Google Drive API

I am trying to get the image file URL from the Google Drive API. Not the webViewLink or webContentLink. The backstory doesn't really matter to the issue but it