Rewritten Search For NPM 4.0
Rewritten Search For NPM 4.0
Written by Kay Ewbank   
Friday, 28 October 2016

 The latest version of NPM has been released with some breaking changes, a rewritten search, and deprecated prepublish.

While this is the first major release since npm 3 back in 2015, the developers say that most of the changes are limited to the command line interface. The new version is still officially a trial release.

npmpic

Writing about the new release on Github, software engineer Kat Marchán described it as the end of an era, explaining that it:

"marks the release when we move both npm@2 and npm@3 into maintenance: We will no longer be updating those release branches with anything except critical bugfixes and security patches."

He also explained that npm is:

"still committed to NPM 2 and NPM 3 working, and NPM 2 remains our LTS (long term support) version, because both of these are going to be used by Node 4 and Node 6 respectively." 

Search is another area that has been worked on. Marchán said on Github that it is still going to be some time before the CLI, registry, and web team are able to overhaul npm search altogether, but until then, they've rewritten the previous implementation to stream results on the fly, from both the search endpoint and a local cache. This won't provide faster results, and this patch does come at the cost of sorting capabilities, but what it does do is start outputting results as it finds them. Marchán said that this should make the experience much better, overall, and the developers believe this is an "acceptable band-aid" until that search endpoint is in place.

Another change to npm 4.0 is the deprecation of the republish lifecycle script. It has been replaced with a prepare script. As Marchán explained on Github:

"If there's anything that really seemed to confuse users, it's that the prepublish script ran when invoking npm install without any arguments.

Turns out many, many people really expected that it would only run on npm publish, even if it actually did what most people expected: prepare the package for publishing on the registry.

And so, we've added a prepare command that runs in the exact same cases where prepublish ran, and we've begun a deprecation cycle for prepublish itself only when run by npm install, which will now include a warning any time you use it that way."

Other changes include the removal of support for partial shrinkwraps. npm-shrinkwrap.json is now considered a complete installation manifest except for devDependencies.

npm

More Information

npm On Github

Related Articles

Yarn The New JavaScript Package Manager  

Package Manager Library Open Sourced

Node.js v6 Released 

Node.js Foundation Releases First Joint Code 

Getting Started with Node.js   

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter,subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin

 

Banner


Eclipse Preferred IDE For Java
12/09/2017

Two recent polls from Opensource.com asked Java and Python developers respectively to cast their votes for their favorite open source IDE. Eclipse emerged as the clear winner for Java and was in secon [ ... ]



Google's Songbird Brings Ambisonics To The Web
30/08/2017

Spatial audio, when done right, is amazing and best through a pair of headphones. We only have two ears, but somehow we manage to hear things in 3D up, down, left, right and back and front. With the a [ ... ]


More News

 

 
 

 

blog comments powered by Disqus

Last Updated ( Friday, 28 October 2016 )
 
 
Banner

   
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.