In a php file I can do:
Is there a way to do this in node, if yes what\'
You can try using JooDee, a node webserver which allows you to embed serverside javascript in your web pages. If you are familiar with Node and PHP/ASP, it is a breeze to create pages. Here's a sample of what a page looks like below:
<: //server side code in here
var os = require('os');
var hostname = os.hostname();
:>
Your hostname is <::hostname:>
Using JooDee also lets you expose server javascript vars to the client with no effort by attaching attributes to the 'Client' object server side, and accessing the generated 'Client' object in your client side javascript.
https://github.com/BigIroh/JooDee