# Any plan to migrate to Node.js v8.x LTS?

**URL:** <https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682>\
**Category:** Features\
**Created:** [December 15, 2017, 10:56am UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682 "2017-12-15T10:56:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [December 15, 2017, 10:56am UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682/1 "2017-12-15T10:56:45Z")

</div>

Node.js version 8.x offers a plenty of new features and improvements comparing with version 6. Although most of it is still compatible with older versions which makes the migration easy.

One of the exciting features is [async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)/[await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) function calls. Briefly it enables to write asynchronous code in synchronous way! As an example compare these two code snippets:

```javascript
N.API.createToken(roomId, name, role, (token) => {
  consume(token);
  // the rest of the code goes here (closure) or in another function
}, (error) => {
  console.error('creating token failed', error);
});

```

```javascript
let token;
try {
  token = await Nuve.API.createToken(roomId, name, role);
} catch (error) {
  console.error('creating token failed', error);
}
consume(token);
// the rest of the code goes here so you won't loose the code scope

```

As you see this way we would get rid of callback functions and write a very cleaner code. Read more about [Callback Hell](http://callbackhell.com/).

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [December 18, 2017, 9:52am UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682/2 "2017-12-18T09:52:11Z")

</div>

I rewrote **NuveClient** code using **async/await** functions. As you see There is no callback function any more. It’s much cleaner. 🕶

> <https://gist.github.com/mkhahani/4b351f552349e64fd66455448a762697>

---

<div class="post-metadata">

**Author:** ![miquel](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/miquel/32/34_2.png) [@miquel](https://discourse.lynckia.com/u/miquel)\
**Post date:** [December 18, 2017, 10:01am UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682/3 "2017-12-18T10:01:16Z")

</div>

Hi Mohsen

Is not only a node.js update what is needed, have you updated only node.js or you updated some other parts, like the mongo connections/queries or websockets?

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [December 18, 2017, 11:18am UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682/4 "2017-12-18T11:18:59Z")

</div>

Hi

I’ve just updated the nuveClient that has no dependency and is used in the user app. Are saying migrating to Node.js v8 needs mongodb and other parts also to be updated?

---

<div class="post-metadata">

**Author:** ![miquel](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/miquel/32/34_2.png) [@miquel](https://discourse.lynckia.com/u/miquel)\
**Post date:** [December 18, 2017, 11:30am UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682/5 "2017-12-18T11:30:33Z")

</div>

No I’m just interesting in the update process, if you have take some steps more in deep on the server side.

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [December 18, 2017, 12:27pm UTC](https://discourse.lynckia.com/t/any-plan-to-migrate-to-node-js-v8-x-lts/682/6 "2017-12-18T12:27:44Z")

</div>

I’ve not tested the whole licode against Node.js v8 yet. Actually I expected to get some feedback from the team if there is any concerns about migration and if no then I would like to work on it.
