下面由sublime教程欄目給大家介紹sublime下建立node編譯系統(tǒng)方法,希望對需要的朋友有所幫助!
Sublime下建立Node編譯系統(tǒng)
做什么的
在Node下建立編譯系統(tǒng)主要的作用是方便開發(fā)調(diào)試文件
怎么建立
選擇 “工具” -> “編譯系統(tǒng)” -> ‘編譯新系統(tǒng)’, 輸入如下內(nèi)容:
{ "cmd": ["node", "$file"], "selector": "source.JS" }
Ctrl + S 保存為node.sublime-bulid 即可
怎么使用
建立測試文件server.js文件內(nèi)容如下:
const http = require('http'); const hostname = 'localhost'; const port = '3000'; const server = http.createServer((req, res) => { res.writeHead(200, {'content-type': 'text/plain'}); res.end('hello world'); }); server.listen(port, hostname, () => { console.log(`server is running at http://${hostname}:${port}`); });
按快捷鍵 Ctrl + B 執(zhí)行文件編譯, 輸出如下內(nèi)容則說明Sublime下的Node編譯系統(tǒng)建立成功
server is running at http://localhost:3000
按Esc鍵關(guān)閉編譯框
小伙伴們在Sublime下建立Node編譯系統(tǒng)環(huán)境是不是灰嘗簡單(^-^), 動手試一下吧!
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載。
THE END