« first day (3695 days earlier)      last day (1236 days later) » 

1:06 AM
Hi all! I'm looking to publish a CLI app on npm for the first time, but I'm not sure how to configure it for publication so that it nicely provides a command when installed globally. The application is written as a bash wrapper around a Node script. I've seen info about "bin" in package.json, but can't get it to work for my bash script. Tips on how to set this up? Thanks!
 
 
4 hours later…
5:33 AM
@IcarusSoftware Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
5:56 AM
hello
 
 
6 hours later…
12:10 PM
hello everyone
 
@DeepanshuGupta Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
Does anyone know about this problem i have posted it 3 days before and I still cant figure out what to do I am stuck here so pls help if anyone know
1
Q: Error occurs while changeStream watch() my mongodb database using nodeJs

Deepanshu Guptaerror : "Collection method watch is synchronous". I have a database whatsAppdb in mongo atlas and now want to make my mongodb realtime so for that I uses changestream in mongodb collections as shown in the code but while doing that an error occurs "collection method watch is synchronous" as shown...

 
user12582392
12:30 PM
is there any trick to export/import async functions in Node's commonJS?
 
user12582392
@JamesBot what do u think
 
1:25 PM
Can someone please help me on this: meta.stackoverflow.com/questions/403188/…
 
@pforpraphul Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1:43 PM
I have simple HTML page with one button. On clicking the button, call to an external API happens and alerts the response. It works in all other browsers, except IE.

Here is the code:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" type="text/javascript"></script>
 
@Richard Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
Hi,
I'm using ReactJS and want to hide/show a div when the String inside a state is not empty.

So far I'have tried to do the following :

const [keywords, setKeywords] = useState();

// other code and functions
         .....
return (
{{textFromFile}.toString().length > 1 ?
 <div className="extractedText">
{textFromFile}
</div>
: null
} </div>         );
 
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<link href="toastr.css" rel="stylesheet">
this works in all browsers except IE
Can someone please help me.
 
@Richard Use && instead of ?
And remove the braces from the first textFromFile
 
What do you mean to use && ?
@geisterfurz007 OMG ... it was as simple as that! Thank you!
 
1:52 PM
return (
  <>{textFromFile.toString().length > 1 && <div className="extractedText">{textFromFile}</div>}</>
);
This probably works as well, saving you the ternary operator with null
@Richard Sweet :)
 
Yes! Thank you!
 
2:22 PM
I have simple HTML page with one button. On clicking the button, call to an external API happens and alerts the response. It works in all other browsers, except IE.






<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
 
AWS lambda vs google cloud functions, thoughts?
 
 
 
3 hours later…
5:37 PM
@pforpraphul IE doesn't support most of ES6
 
6:33 PM
yo, hi
 
@TudorAlexandru Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
 
2 hours later…
8:13 PM
I'm trying to load a URL into the <iframe>
But dynamically, iframe gets style="display: none !important"
If I remove it via the inspection
It gets added again
what could be the problem?
@pforpraphul Probably the arrow functions aren't supported in the IE. Try using the regular "function" keyword to declare the callback function
 
 
3 hours later…
user12582392
11:19 PM
trying to pass this JS to mongodb
 
user12582392
    const re = new RegExp(key)
    const userText= { "$match":{"msg":{"$regex":re, "$options":"i"} }}
 
user12582392
no luck. whatever I do it ends up $regex: {}. Ideas?
 
user12582392
was querying the wrong field
 

« first day (3695 days earlier)      last day (1236 days later) »