Posts by Lucas Beier • 186 points
4 posts
-
4
votes3
answers1856
viewsA: How do NOT differentiate upper and lower case with index?
A simpler form that avoids indexOf, toLowerCase and toUpperCase is to use regular expression. var name = $(".infoname").text(); if(name.match(/carro/i))) { alert("existe"); } else { alert("não…
javascriptanswered Lucas Beier 186 -
0
votes2
answers431
viewsA: Check if git is installed using Node
The simplest solution I could think of was this: const platform = process.platform const { spawn } = require('child_process') const where = platform === 'win32' ? 'where' : 'which' const out =…
-
1
votes1
answer809
viewsA: Pass parameters via POST with Node.js
Using pure Node only, you can do something like this: const querystring = require('querystring') const https = require('https') const postData = querystring.stringify({ txtLogin: 'login', txtSenha:…
node.jsanswered Lucas Beier 186 -
2
votes1
answer2316
viewsA: What is the function of the.Switch app in Express?
The function app.listen() Express starts a UNIX socket and listens to the connections in a given path. The function app.listen(port, [hostname], [backlog], [callback]) Express is the same…