forked from nodejs/node-v0.x-archive
-
Notifications
You must be signed in to change notification settings - Fork 24
API changes between v0.4 and v0.6
koichik edited this page Oct 14, 2011
·
43 revisions
When editing this page please be as detailed as possible. Examples are encouraged!
- The
customFds
option to thechild_process.spawn
method is deprecated. Only the values -1, 0, 1, 2 will work withcustomFds
now and only if those are TTY file descriptors. You can however use thestdinStream
,stdoutStream
, andstderrStream
options to achieve similar functionality. - You can no longer send a file descriptor through a unix pipe. Instead you can send a handle via
child_process.fork
. - The
'unix_dgram'
type to thedgram.createSocket()
is no longer supported. -
fs.symlink
takes an optionalmode
argument, which can either be 'dir' or 'file'. The default is 'file'. This argument is only needed for Windows (it's ignored on other platforms). -
http.Agent.appendMessage
was removed. -
http.getAgent()
was removed. Usehttp.globalAgent
instead. - Not
httpAgent
buthttp.ClientRequest
emits'upgrade'
event. -
https.request()
andhttps.get()
with defaultAgent
ignorekey
,cert
andca
options. Use customAgent
. -
net.Server.listenFD()
was no longer supported. - The
require.paths
have been removed (useNODE_PATH
environment variable instead). - C++
node::EventEmitter
has been removed. Instead usenode::MakeCallback()
-
EventEmitter.removeAllListeners()
allows to remove all listeners at once. -
process.ENV
was removed. Useprocess.env
instead. -
process.ARGV
was removed. Useprocess.argv
instead. -
process.binding('stdio')
was removed. This was a private API. You shouldn't have been using it in the first place. -
process.stdin
,process.stdout
andprocess.stderr
are getters now. - [V8]
RegExp
was no longer aFunction
.
-
assert(val)
as a shorthand forassert.ok(val)
-
Buffer
supports'hex'
encoding. Buffer.readInt8()/readInt16BE()/readInt16LE()/readInt32LE()/readInt32BE()
Buffer.readUInt8()/readUInt16BE()/readUInt16LE()/rreadUInt32LE()/readUInt32BE()
Buffer.readFloatBE()/readFloadLE()/readDoubleBE()/readDoubleLE()
Buffer.writeInt8()/writeInt16BE()/writeInt16LE()/write32BE()/write32LE()
Buffer.writeUInt8()/writeUInt16BE()/writeUInt16LE()/writeU32BE()/writeU32LE()
Buffer.writeFloatBE()/writeFloatLE()/writeDoubleBE()/writeDoubleLE()
- Typed Arrays
Buffer.fill()
child_process.fork()
-
crypto.createDiffieHellman()
,crypto.pbkdf2()
,crypto.randomBytes()
-
fs.utimes()/utimesSync()
,fs.futimes()/futimesSync()
fs.watch
-
start
option tofs.createReadStream()
andfs.createWriteStream()
. - Module system supports
.json
module. net.connect()
-
net.Socket.remotePort
,bytesRead
,bytesWrite
-
os.arch()
,os.platform()
,os.uptime()
,os.getNetworkInterfaces()
path.relative()
-
process.arch
,process.uptime()
-
tls.CryptoStream.getSession()
andsession
option totls.connect()
. -
tls.Server
supports NPN (Next Protocol Negotitation) and SNI (Server Name Indication). util.format()
-
zlib
module http://nodejs.org/docs/v0.5.9/api/zlib.html