borisyankov/DefinitelyTyped — pull request #1321 by AgentME (2013-11-23 22:44:34+00:00)
Title: Definition Fixes for node and express

node

* setTimeout, setInterval, setImmediate are fixed to accept more arguments.

* setTimeout, setInterval, clearTimeout, clearInterval are changed to return and accept objects of the new Timer interface, which exposes the ref() and unref() methods.

* fs.readFileSync is changed so that it returns a string if it is passed an options parameter with an "encoding" property, and returns a NodeBuffer otherwise.

* fs.watchFile and fs.unwatchFile listener parameters are fixed. listener is a callback with two parameters, not an object with two properties.

* fs.watch is fixed so a listener parameter can be given without an options parameter.

* crypto.randomBytes is fixed so that it can be called synchronously, returning a NodeBuffer.

* crypto.pseudoRandomBytes is added.

express

* app.listen is fixed so that it can be called with a port, hostname, and optional callback without a backlog parameter.

* app.listen is fixed so callback parameter is always optional.

* CSRF protection middleware definition is fixed so options parameter is optional.

* req.csrfToken method is added since the CSRF protection middleware has been updated.