- 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.
- Bootstrap Site Blueprints Volume II
- HTML5移動Web開發技術
- 自己動手實現Lua:虛擬機、編譯器和標準庫
- 重學Java設計模式
- TradeStation交易應用實踐:量化方法構建贏家策略(原書第2版)
- Python機器學習基礎教程
- Swift語言實戰精講
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- Swift 4從零到精通iOS開發
- 零代碼實戰:企業級應用搭建與案例詳解
- 計算機應用基礎項目化教程
- SQL Server 2008中文版項目教程(第3版)
- 零基礎學HTML+CSS第2版
- Mastering ASP.NET Web API
- OpenCL異構并行計算:原理、機制與優化實踐