javascript - how print modules on web -


var http = require('http');    function start() {  function onrequest(req, res) {      console.log("request received.");      res.writehead(200, {'content-type': 'text/plain'});      res.end();  }    http.createserver(onrequest).listen(8888);  console.log("server has started.");  }  exports.start = start;    var procfs = require('procfs-stats');  var ps = procfs(process.pid);    function sysusage() {      ps.io(function(err, io) {          console.log('my process has done io', io);      });  }  exports.sysusage = sysusage;

here code, new in node.js how can print "procfs-stats" , "libcpuusage" on web?, not in console. thanks

you need template engine, there many (http://garann.github.io/template-chooser/), common ones are:

but it's choose preferred node application.

probably best option install , use expressjs framework in node.js app, gives powerful suite of features used in app. , of course, gives simple way add template engine too.

please refer specific needs: using template engines express


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -