首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >windows上的Node.Js -如何清除控制台

windows上的Node.Js -如何清除控制台
EN

Stack Overflow用户
提问于 2012-01-26 01:15:26
回答 18查看 101.2K关注 0票数 92

作为一个全新的node.js环境和理念的新手,我想回答几个问题。我已经下载了用于windows的node.js安装程序,并且node package manager.Windows命令提示符目前正在用于运行nodejs应用程序。

  1. cls清除命令窗口或命令提示符中的错误。有没有node.js的等价物?console.clear不存在;(或者它以某种其他形式存在?
  2. 我通过下面的代码创建了一个服务器

var = require(" http ");http.createServer(function (request,response) { response.writeHead(200,{ "Content-Type":"text/html“});response.write("Hello World");console.log(”欢迎世界“)response.end();}).listen(9000,"127.0.0.1");

我将代码更改为下面的代码,并刷新浏览器,发现内容类型没有更改,如何查看更改?

var http = require("http");
http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  console.log("welcome world")
  response.end();
}).listen(9000,"127.0.0.1");
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9006988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档