Introduction to the Node. Js
  • The most notable feature of Node.js is that it runs on the server side, which is ‾\underline{\text{can run on the server side (unlike other scripting languages). As well as good multi-platform compatibility (supporting Windows, Linux, Mac OS X, SunOS, and FreeBSD), it is the most important script design language, which is ‾ {\text{script design language}}.

  • Normal JavaScript scripting languages need to be executed in a browser environment. Node.js is a server-side scripting language that can be interpreted and executed directly at the back end.

Node.js is not a Javascript application. It is a Javascript runtime environment written in C++.

Node.js is installed and deployed

The Node.js installation package has two versions: Installer and Binary on Windows. Installer is a common installation package release (.msi),binary is a binary version, you can download and run (.exe) directly. You are advised to use the. Msi installation version

Test the Node development environment
node -v
npm -v
Copy the code
Build the Node application architecture with Webpack
  • Webpack is a front-end resource loading/packaging tool. It performs static analysis based on module dependencies, and then generates the corresponding static resources from these modules according to the specified rules.

Steps to build a Node application using Webpack:

  1. Create the Node application and go to this directory:
mkdir vueproject && cd vueproject
Copy the code
  1. Initialize the project with the NPM command:
NPM init -y // NPM package management command tool // Init indicates the initialization of Node application projects. This command argument generates a package.json configuration file that describes the detailed configuration information for the project. "-y" indicates that the project uses the default configuration parameters (eliminating manual operations)Copy the code
  1. Install Webpack locally by using the NPM command:
NPM install webpack webpack-cli --save-dev // install Installs the third-party development package. The development package names webpack and webpack-CLI are specified. Webpack-cli Indicates the command line tool of Webpack, that is, webpack can be used in the command line. "--save-dev" indicates that the installation package is a dependency during debugging and development. The information is recorded in the devDependencies sub-item in the package.json file, and these packages are not required for later project releases.Copy the code

The node_modules directory houses the various development packages installed with the NPM command, as well as the necessary dependencies for the entire Node ecosystem.

Package-lock. json configuration file This file is automatically generated after the “NPM install” command is used to install the development package. This file locks the minor version number of the current installation. Therefore, when users use the “NPM install” command again, they can avoid upgrading the development package directly to the latest version through the package.json configuration file, effectively avoiding various dependency conflicts caused by the version upgrade.

Study book “Vue.js +Node.js full stack Development Actual Combat” nodejs.org/zh-cn/ node.js official website (download and news of the latest version of Node.js, Rich documentation) cnodejs.org CNode community (Node. Js open source technology community BBS) nodejs. Cn Node. Js Chinese website npm.taobao.org taobao mirror code.visualstudio.com/Download VS Code: System Installer


www.lodashjs.com/docs/lodash… Loadsh plugin (high performance, modular Javascript utility library)