Rescreve essa outra parte do artigo com as seguintes condições: 1. Reescreva em…
- User
Rescreve essa outra parte do artigo com as seguintes condições:
- Reescreva em português.
- Toda parte que utilizar uma palavra difícil ou se há uma parte difícil de entender, deixe ele mais claro e fácil de entender.
- O artigo deve reescrito em forma de tutorial passo a passo.
- Não elimine informações dadas no artigo.
"Introduction In the previous lesson, we learned about ES6 modules and the syntax used for importing and exporting things between modules. As we build bigger, more complex applications, we may not want to write everything ourselves. We may want to import third party code to handle some things for us, which can range from helper functions other people wrote, to entire frameworks for us to build our application within. To find and import these third party packages with ease, we need the help of a package manager such as npm!
Lesson overview This section contains a general overview of topics that you will learn in this lesson.
Understand what npm is. Understand the purpose of the package.json file. npm npm (no capitals!) is a package manager - a gigantic repository of plugins, libraries, and other tools, which provides us with a command-line tool we can use to install these tools (that we call “packages”) in our applications. We will then have all our installed packages’ code locally, which we can import into our own files. We could even publish our own code to npm!
You may recall installing npm in the Foundations course in order to install the Jest testing framework to do the JavaScript exercises. Funnily enough, npm does not stand for “Node Package Manager”, though you will often see it referred to as such.
If you are in the Full Stack Ruby on Rails pathway, you will have already been introduced to Yarn, another JavaScript package manager. For this course, we will be using npm.
As our applications get more complex and more and more files are needed (whether they are our own files or files from packages we’ve installed and imported), managing many of these dependencies can become rather troublesome, especially when packages get updated. This can get even more troublesome when we consider that we may end up sending many JavaScript files to the browser to download. In the next lesson, we will introduce bundlers, tools that lets us write multiple files that are better for us to work with, then bundle them together into fewer smaller files which will ultimately be sent to the browser instead.
package.json npm revolves around a file called package.json. It’s a JSON file containing information about our project, such as its name or any dependencies and their version numbers. npm can read this file and do things such as install all of the listed dependencies with the correct versions, and running commands that you’ve set as an npm script (we will cover npm scripts in a later lesson).
For example, here is the package.json file for The Odin Project’s curriculum repo that houses all of the lesson files (including this lesson you are doing right now):
- Assistant