Developers create a small building block of code that solves one problem well, then "package" the code into a directory that follows npm guidelines. A typical application, such as a website, will consist of dozens or hundreds of small packages. Its developer uses the packages to compose larger custom solutions.
npm makes it possible for your team to draw on the expertise of people who have focused on a particular problem areas, whether in your organization, or outside of it. Use npm to help your team work together better, sharing developer talent across projects. Use npm to manage multiple versions of code.
To find packages, browse the npm website.
While browsing, you'll find lots of Node modules, which makes sense, since npm started as the Node package manager. Node modules can be used on the server side. There are also many packages which add commands for you to use in the command line. And there are an ever-increasing amount of packages that can be used on the front end. (To understand the difference between node modules and packages, click here).
npm consists of three distinct pieces:
The website is the primary way developers discover packages, set up profiles, and manage other aspects of their npm experience.
The registry is a large database of information about packages.
The CLI, run from a terminal, is how developers publish their packages on the registry or download packages they wish to install.
For example, suppose you wanted to use bar codes (QR codes) in your application. Rather than spend weeks figuring out how to do this, why not see if someone has posted a package that creates QR codes? Start by entering a value in the search bar:
Related options will appear:
Or, if you click, you will have a chance to filter the possibilities even more:
When you choose a package to explore, more information appears. This information is written by the package author(s) so details vary.
Now, you can read the developer's instructions to discover how to use this package.
Now that you know what npm is, it's time to get started. Install npm. We look forward to seeing what you will create!
To learn more about npm as a product, new features on the way, and interesting uses of npm, sign up for our newsletter, or read newsletter archives, at npm-weekly
© npm, Inc. and Contributors
Licensed under the npm License.
npm is a trademark of npm, Inc.