iT邦幫忙

5

Node.js 初體驗(play)

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
第一篇:Node.js 初體驗,輕輕鬆鬆寫網站!!! (http://ben6.blogspot.com/2011/07/nodejs.html)
內容摘要:
話說Node.js 是一個有Event-I/O 的 V8 Javascript (google 出的 Javascript V8引擎)。
它十分容易上手,你只要略通Javascript,再參考說明文件,馬上就能寫一個簡單的網站。
例如:
Sample-web-server.js

    var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');

第二篇:Node.js 與 IIS 初探 (http://blog.lyhdev.com/2012/01/nodejs-iis.html)
內容摘要:

Node.js 讓 JavaScript 也能用於網站後端開發,開發人員只要精熟 JavaScript 語言,就能夠輕鬆開發高效能 Web 應用程式。

習慣在 Windows + IIS 工作的朋友,不妨也玩玩看 Node.js。

在 Node.js 官網已經提供安裝程式,包含 NPM(Node.js 的套件管理工具)。
iisnode 是讓 IIS 管理 Node.js 程式的 IIS 模組,也有很簡便的安裝程式。

https://github.com/tjanczuk/iisnode

關於 iisnode 的使用,請參考原作者這篇。

http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html

第三篇:Node JS 小註解 (http://www.cash.idv.tw/wordpress/?p=6423)
內容摘要:
網路上介紹 node JS 的文章已經相當多了, 切入的角度也各有不同. 但最重要的一件事是: node 是一個 Java script 的 server. 首先要有 Java script 寫好的 .js 檔, node server 才能夠去執行它.

通常我們會在瀏覽器端執行 Java script, 例如寫個表單程式之類的, 使用 Java script 會很方便. 而 Node JS 是在伺服器端運行 Java script 用的, 甚至 Node JS 本身就可以當作 web server 的平台, 拿來建立 HTTP server 之用.

從技術面來看, node JS 基於 Google V8 的 Java script engine (這也是 Chomre 在用的), 並且增加了一些內建的函式庫. 基本上我們可以找到其他一些性質相同的替代方案, 例如 common JS, RequireJS 等等. 相關訊息可以參考其他連結.


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

0
fillano
iT邦超人 1 級 ‧ 2012-04-18 16:15:49

最後一段的結論怪怪的XD

  1. commonjs其實是一個制定「標準」的組織,node.js的特色之一,就是有一個commonJS module 1.0規範的模組系統。

  2. requireJS主要應用還是在client端,他有一個重要的特色是AMD(async module definition),可以動態載入模組,並且管理相依性。node.js使用的模組管理系統是靜態的,並不能在自己的程式中動態處理模組的相依性,必須靠NPM來管理。AMD對client應用來說有很大的幫助,但是對server應用來講就不是那麼重要了。

這兩個都不是node.js的替代方案...

我要留言

立即登入留言