What’s new for Node?

Speed things up and bring the new­est fea­tures server-side in ver­sion 10

Web Designer - - Javascript: What’s New? -

The lat­est ma­jor up­date came in April this year and brought with it lots of small but very use­ful fea­tures to make the de­vel­op­ment of server ap­pli­ca­tions eas­ier and more se­cure. The most prom­i­nent up­date is to do with mod­ules. Node has been us­ing Com­monjs mod­ules for a long time. With the in­tro­duc­tion of Ec­mascript mod­ules in ES2015, Node has been try­ing to let the two work to­gether de­spite their slight dif­fer­ences. They are now avail­able when used with the ‘--ex­per­i­men­tal-mod­ules’ flag. An in-depth explainer for this by Gil Ta­yar can be found at https://medium.com/@gilta­yar/ ee5ea3001f71. Er­rors have also been sig­nif­i­cantly im­proved, with stan­dard­ised codes be­ing in­tro­duced where there were pre­vi­ously only string de­scrip­tions. Whilst be­fore any er­rors would have to match against that generic string, ver­sion 10 in­tro­duces stan­dard­ised er­ror codes that return along­side the string de­scrip­tion. A slight change to the de­scrip­tion of an er­ror will no longer break an ap­pli­ca­tion. A new set of ex­per­i­men­tal asyn­chro­nous file sys­tem meth­ods have also been added to the “fs” mod­ule. In­stead of us­ing call­backs, these use prom­ises to com­mu­ni­cate with the sys­tem in a more read­able and ef­fi­cient man­ner. Fi­nally, ver­sion 10.7 also in­cludes ver­sion 6.1 of npm. This re­lease fo­cuses mainly on per­for­mance and se­cu­rity im­prove­ments, in­clud­ing the new ‘npm audit’ com­mand, which can check if any de­pen­dant pack­ages have known se­cu­rity vul­ner­a­bil­i­ties.

With the in­tro­duc­tion of Ec­mascript mod­ules in ES2015, Node has been try­ing to let the two work to­gether de­spite their slight dif­fer­ences

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.