Npm (software)
npm
Npm-logo.svg
Developer(s) Isaac Z. Schlueter, Forrest Norvell, Robert Kowalski, Domenic Denicola, Tim Oxley, Evan Meagher, others
Initial release January 12, 2010; 7 years ago (2010-01-12)[1]
Stable release
4.2.0 / 26 January 2017; 59 days ago (2017-01-26)[2]
Preview release
4.3.0 / 9 February 2017; 45 days ago (2017-02-09)[3]
Written in JavaScript
License Artistic License 2.0
Website www.npmjs.com

npm is the default package manager for the JavaScript runtime environment Node.js.

History

npm is written entirely in JavaScript and was developed by Isaac Z. Schlueter as a result of having "seen module packaging done terribly" and with inspiration from the shortcomings of other similar projects such as PHP (PEAR) and Perl (CPAN).[4]

Description

npm is automatically included when Node.js is installed.[5] npm consists of a command line client that interacts with a remote registry. It allows users to consume and distribute JavaScript modules that are available on the registry.[6] Packages on the registry are in CommonJS format and include a metadata file in JSON format.[7] Over 280,000 packages are available on the main npm registry.[8] The registry has no vetting process for submission, which means that packages found there can be low quality, insecure, or malicious.[7] However, the npm server administrators are fully capable of deleting malicious packages or banning malicious users.[9] npm exposes usage statistics and number of depending packages to assist developers in picking libraries.[10]

Packages on npm are registered on a first-come, first-served basis and do not distinguish among authors, meaning that the unpublishing of a package can not only break the projects that depend on it, but also pose a security risk.[11] For example, a package named "left-pad" that only padded the left side of strings inadvertently caused many builds to fail when it was removed.[12]

Usage

npm can manage packages that are local dependencies of a particular project, as well as globally-installed JavaScript tools.[13] When used as a dependency manager for a local project, npm can install, in one command, all the dependencies of a project through the package.json file.[14] In the package.json file, each dependency can specify a range of valid versions using the semantic versioning scheme, allowing developers to auto-update their packages while at the same time avoiding unwanted breaking changes.[15] npm also provides version-bumping tools for developers to tag their packages with a particular version.[16]

Alternatives

There are a number of open-source alternatives to npm for installing modular JavaScript, including ied, pnpm, npm-install, npmd, and Yarn, the last of which was released by Facebook in October 2016.[17] They are all compatible with the public npm registry and use it by default, but provide different client-side experiences, usually focused on improving performance and determinism[18] versus the npm client.

See also

References

  1. ^ "Earliest releases of npm". GitHub. Retrieved 2016. 
  2. ^ "npm/CHANGELOG.md at latest". GitHub. 2017-01-26. Archived from the original on 2017-01-26. Retrieved . 
  3. ^ "npm/CHANGELOG.md at latest". GitHub. 2017-02-09. Archived from the original on 2017-02-09. Retrieved . 
  4. ^ Schlueter, Isaac Z. (25 March 2013). "Forget CommonJS. It's dead. **We are server side JavaScript.**". GitHub. 
  5. ^ Dierx, Peter (30 March 2016). "A Beginner's Guide to npm -- the Node Package Manager". sitepoint. Retrieved 2016. 
  6. ^ Ampersand.js. "Ampersand.js - Learn". ampersandjs.com. Retrieved 2016. 
  7. ^ a b Ojamaa, Andres; Duuna, Karl (2012). "Assessing the Security of Node.js Platform". IEEE Xplore. Retrieved 2016. 
  8. ^ Kennedy, Hugh; DeVay, Paul. "Understanding npm". Nsight. Retrieved 2016. 
  9. ^ npm, Inc. "npm". npm. Retrieved 2016. 
  10. ^ https://npm-stat.com/
  11. ^ Yegulalp, Serdar (23 March 2016). "How one yanked JavaScript package wreaked havoc". InfoWorld. Retrieved 2016. 
  12. ^ Williams, Chris. "How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript". The Register. Retrieved 2016. 
  13. ^ Ellingwood, Justin. "How To Use npm to Manage Node.js Packages on a Linux Server". DigitalOcean. Retrieved 2016. 
  14. ^ "npm-install". docs.npmjs. Retrieved 2016. 
  15. ^ "semver". docs.npmjs. Retrieved 2016. 
  16. ^ "npm-version". docs.npm. Retrieved 2016. 
  17. ^ "Hello, Yarn!". The npm Blog. 11 October 2016. Retrieved 2016. 
  18. ^ Katz, Yehuda (11 October 2016). "Why I'm working on Yarn". Retrieved 2016. 

External links



  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.


Npm_(software)
 
Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.


Manage research, learning and skills at defaultLogic. Create an account using LinkedIn or facebook to manage and organize your IT knowledge. defaultLogic works like a shopping cart for information -- helping you to save, discuss and share.


  Contact Us