- Progressive Web Apps with React
- Scott Domes
- 266字
- 2021-07-08 09:36:14
What is npm?
A React application is primarily JavaScript. If you have experience working with JavaScript, you know that the browser is perfectly capable of parsing and executing JavaScript on its own.
In most basic websites, we link to the JavaScript needed for the page in a <script> tag, and the browser downloads and runs it.
We'll be doing something similar with our React application (with considerable complications; more on that in Chapter 2, Getting Started with Webpack).
However, JavaScript is no longer confined to the browser. More and more applications are using JavaScript on the backend as well, with JavaScript running in its own environment.
Long story short, JavaScript is now everywhere, and the driving force behind this proliferation is Node.js, a JavaScript runtime library, which lets you run JavaScript outside of a browser environment.
Okay, this is exciting, but why does this matter for our React project?
Node also introduced the idea of packages to JavaScript. Packages are essentially third-party libraries of code that you can install to your application and then import and use where and when you need them. You can use packages even if your application is not a Node application.
React is one such package. Webpack, mentioned earlier, is another one. In short, in order to build a complex web application, we will inevitably rely on a lot of other people's code, so we need packages, and we need Node's package manager (shorthand npm) to install them.
We’ll also use npm to start up our application and do some basic tasks, but its primary purpose is to manage packages.
- HTML5移動Web開發(fā)技術
- 深入實踐Spring Boot
- PyQt從入門到精通
- Spring Boot+Spring Cloud+Vue+Element項目實戰(zhàn):手把手教你開發(fā)權限管理系統(tǒng)
- Linux命令行與shell腳本編程大全(第4版)
- Apache Kafka Quick Start Guide
- SQL Server與JSP動態(tài)網站開發(fā)
- JavaScript腳本特效編程給力起飛
- .NET 4.5 Parallel Extensions Cookbook
- 軟件工程與UML案例解析(第三版)
- Python數據可視化之matplotlib實踐
- 深入大型數據集:并行與分布化Python代碼
- Expert Cube Development with SSAS Multidimensional Models
- Mastering R for Quantitative Finance
- TensorFlow.NET實戰(zhàn)