Node.js is opensource en platformonafhankelijk en is gericht op het ontwikkelen van server-side-webapplicaties. Die applicaties worden geschreven in JavaScript en uitgevoerd binnen de Node.js runtime op de server. Het biedt een event-gedreven omgeving aan waarbij non-blocking I/O een belangrijk uitgangspunt is geweest. Voor meer informatie verwijzen we jullie door naar deze pagina. Het ontwikkelteam heeft versie 5.0 vrijgegeven, een standaarduitgave waarop acht maanden ondersteuning gegeven gaat worden. De release notes zijn hieronder voor je neergezet:
Node v5.0.0 (Stable)Say hello to Node.js v5! It's true that we only recently released Node.js v4.0.0, however this new release doesn't mean that v4 is going away. In fact, v4 is going to live for a lot longer than v5.
According to our new LTS (Long-term Support) plan, Node.js v4 Argon will continue to be supported for 30 months, ending in April 2018. This new version of Node.js, however, will only be supported for 8 months, with a new major version, v6, being released in April 2016. Node.js v6 will eventually turn into a new LTS version that will have a similar support timeline to v4. In this way, we will have a new Stable version of Node.js every 6 months with every second one of these turning into an LTS line. If our LTS plan is new to you, read more about how it's going to work so you can make a properly informed decision regarding what version of Node.js to adopt.
The general rule for deciding which version of Node.js to use is:
- Stay on or upgrade to Node.js v4.2.x if you need stability and have a complex production environment, e.g. you are a medium or large enterprise.
- Upgrade to Node.js v5.x if you have the ability to upgrade versions quickly and easily without distributing your environment and want to play with the latest features as they arrive.
The release notes below are annotated with the main breaking changes that warrant the jump to v5. Note that because this new version of Node.js is shipping with a new version of V8, you will need to recompile any native add-ons you have already installed or you will receive a runtime error when trying to load them. Use
Notable Changesnpm rebuild
or simply remove your _nodemodules directory andnpm install
from scratch.Known issues
- buffer: (Breaking) Removed both
'raw'
and'raws'
encoding types fromBuffer
, these have been deprecated for a long time (Sakthipriyan Vairamani) #2859.- console: (Breaking) Values reported by
console.time()
now have 3 decimals of accuracy added (Michaël Zasso) #3166.- fs:
fs.readFile*()
,fs.writeFile*()
, andfs.appendFile*()
now also accept a file descriptor as their first argument (Johannes Wüller) #3163.- (Breaking) In
fs.readFile()
, if an encoding is specified and the internaltoString()
fails the error is no longer thrown but is passed to the callback (Evan Lucas) #3485.- (Breaking) In
fs.read()
(using thefs.read(fd, length, position, encoding, callback)
form), if the internaltoString()
fails the error is no longer thrown but is passed to the callback (Evan Lucas) #3503.- http:
- Fixed a bug where pipelined http requests would stall (Fedor Indutny) #3342.
- (Breaking) When parsing HTTP, don't add duplicates of the following headers:
Retry-After
,ETag
,Last-Modified
,Server
,Age
,Expires
. This is in addition to the following headers which already block duplicates:Content-Type
,Content-Length
,User-Agent
,Referer
,Host
,Authorization
,Proxy-Authorization
,If-Modified-Since
,If-Unmodified-Since
,From
,Location
,Max-Forwards
(James M Snell) #3090.- (Breaking) The
callback
argument toOutgoingMessage#setTimeout()
must be a function or aTypeError
is thrown (James M Snell) #3090.- (Breaking) HTTP methods and header names must now conform to the RFC 2616 "token" rule, a list of allowed characters that excludes control characters and a number of separator characters. Specifically, methods and header names must now match
/^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/
or aTypeError
will be thrown (James M Snell) #2526.- node:
- npm: Upgraded to version 3.3.6 from 2.14.7, see https://github.com/npm/npm/releases/tag/v3.3.6 for more details. This is a major version bump for npm and it has seen a significant amount of change. Please see the original npm v3.0.0 release notes for a list of major changes (Rebecca Turner) #3310.
- src: (Breaking) Bumped
NODE_MODULE_VERSION
to47
from46
, this is necessary due to the V8 upgrade. Native add-ons will need to be recompiled (Rod Vagg) #3400.- timers: Attempt to reuse the timer handle for
setTimeout().unref()
. This fixes a long-standing known issue where unrefed timers would perviously holdbeforeExit
open (Fedor Indutny) #3407.- tls:
- Added ALPN Support (Shigeki Ohtsu) #2564.
- TLS options can now be passed in an object to
createSecurePair()
(????????? ????) #2441.- (Breaking) The default minimum DH key size for
tls.connect()
is now 1024 bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent "logjam" attacks. A newminDHSize
TLS option can be used to override the default. (Shigeki Ohtsu) #1831.- util:
- (Breaking)
util.p()
was deprecated for years, and has now been removed (Wyatt Preul) #3432.- (Breaking)
util.inherits()
can now work with ES6 classes. This is considered a breaking change because of potential subtle side-effects caused by a change from directly reassigning the prototype of the constructor usingctor.prototype = Object.create(superCtor.prototype, { constructor: { ... } })
to usingObject.setPrototypeOf(ctor.prototype, superCtor.prototype)
(Michaël Zasso) #3455.- v8: (Breaking) Upgraded to 4.6.85.25 from 4.5.103.35 (Ali Ijaz Sheikh) #3351.
- Implements the spread operator, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator for further information.
- Implements
new.target
, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target for further information.- zlib: Decompression now throws on truncated input (e.g. unexpected end of file) (Yuval Brik) #2595.
- Surrogate pair in REPL can freeze terminal. #690
- Calling
dns.setServers()
while a DNS query is in progress can cause the process to crash on a failed assertion. #894url.resolve
may transfer the auth portion of the url when resolving between two full hosts, see #1435.- Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See #2088, #3401 and #3519.