顯示具有 NodeJS 標籤的文章。 顯示所有文章
顯示具有 NodeJS 標籤的文章。 顯示所有文章

2013年10月1日 星期二

NodeJS , return From call Function.

在 NodeJS , 因為是 事件驅動

所以在 流程上的控制比較無法像一般程式那麼直覺式的方式去執行

可以利用 callback 的方式,轉換成比較像是 一般程式 的執行方式去呼叫

HTTP POST in NodeJS

使用 NodeJS 建立 HTTP POST 傳送

( PS : 範例中,是 讀取  js file )


async.forever

NodeJS Async套件中,其中一個功能筆記

在 Async 有一個方法 forever ( 以下是

forever(fn, callback)

Calls the asynchronous function 'fn' repeatedly, in series, indefinitely. If an error is passed to fn's callback then 'callback' is called with the error, otherwise it will never be called.