Version 1.0.0 of io.js was released today. This post is going to give you an overview of what io.js is, what the differences and benefits are and what the aim of the project is.
The beginning – how it started
First of all, io.js is a fork of Node.jsNode.js is an asynchronous event-driven JavaScript runtime and is the most effective when building scalable network applications. Node.js is free of locks, so there's no chance to dead-lock any process., and was forked by Fedor Indutny. With that said, Fedor is not the leader of the project, io.js is incorporated as an open governance structure. The key people included in the fork are:
But why did this fork happen?
In July, 2014 they started working with Joyent to ensure that the contributors and the community has the ability to help fix the problems that Node.js faces / will face.
Then in August Node Forward was started to help improve Node.js:
A broad community effort to improve Node, JavaScript, and their ecosystem through open collaboration.
Due to trademark restrictions, the guys could not do a release – but luckily for the community, all those efforts are incorporated into io.js.
After this, Fedor decided to fork Node.js under the name io.js.
The main differences
As you could have already noticed, io.js introduces proper semver, starting with 1.0.0. Also, io.js comes with nightly builds too.
But what’s really great about this release is the updated V8 engine (from version 3.14.5.9 in Node.js v0.10.35 and 3.26.33 in Node.js v0.11.14 to 3.31.74.1 for io.js v1.0.0), which brings us ES6 features, without the --harmony
flag – at least those that don’t require a flag in V8 neither.
What about the staging/in-progress features?
All the new features that are considered staging/in-progress by the V8 team are available under the flags starting with --harmony
. These are not meant for production systems.
Changes in the core modules
io.js not only brings us ES6, but also new (experimental) core modules and new features/fixes to the existing ones as well.
Available ES6 features
The following list of features are available without using any flags:
- Block scoping (
let
,const
) - Collections (
Map
,WeakMap
,Set
,WeakSet
) - Generators
- Binary and Octal literals
- Promises
- New String methods
- Symbols
- Template strings
You can always check which version of V8 is used by your installed io.js simply, with:
iojs -p process.versions.v8
With this information you can check the available features. Also, you can check this ES6 compat-table as well.
New modules
io.js ships with new core modules as well, that can be used without installing from NPMnpm is a software registry that serves over 1.3 million packages. npm is used by open source developers from all around the world to share and borrow code, as well as many businesses. There are three components to npm: the website the Command Line Interface (CLI) the registry Use the website to discover and download packages, create user profiles, and.... These are:
- smalloc: a new core module for doing (external) raw memory allocation/deallocation/copying in JavaScript
- v8: core module for interfacing directly with the V8 engine
For the complete API Reference, check: https://iojs.org/api/
For the complete changelog, check:
https://github.com/iojs/io.js/blob/v1.x/CHANGELOG.md
Get started
To get started with io.js, visit iojs.org and download the installer for your system.
After installing it, you can simply start your application the very same way you did with Node.js:
iojs app.js
If you are used to nvm, then we have good news for you: an io.js compatible version is coming soon!
I would encourage you to test your modules with io.js, and report to https://github.com/iojs/io.js if you find something unexpected.
What’s next?
On the longer run io.js and Node.js will be merged back together – at least that’s the plan. We hope that the project accomplishes its goals, and help the JavaScript community move forward.