Node JS

PUG Switch Case Statement Demo using Node JS and PowerShell

Posted on

A friend of mine asked a very good question “How can I use switch case statement in PUG using variable from route?” which took an hour time to figure it out! See the documentation for case statement here. I have a route like shown below app.get(“/”, function (request, response) { child = spawn(‘powershell.exe’, [“C:\\projects\\caseDemo\\scripts\\DayOfWeek.ps1”]) child.stdout.on(‘data’, […]