node.js-express module

Shang Silicon Valley 95-121 1. Introduction to express 2. First experience with express // 1. Import express const express = require(‘express’); // 2. Create application object const app = express(); // 3. Create route // When the browser’s request is get and the accessed address is /home, the callback function (req, res) => {} is […]

Application of multi-threading in Node.js

Foreword Originally, JavaScript was designed to perform simple web tasks, such as form validation. It was not until 2009 that Ryan Dahl, the creator of Node.js, made developers realize that back-end development through JavaScript was possible. In back-end development, the most commonly used functions are multi-threading and synchronization between threads. Today, small The editor will […]

Node.js user information management list

Preparation Create file workspace user Create MongoDB folder Copy the files in MongoDB into it In the D:\MongoDB directory: Create data Create log Download MongoDB download link: https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.6.9.zip My compressed package is mongodb-win32-i386-2.6.9.zip, unzip it and put it in D:\MongoDB (manually created) Install 1. Manually create a new database folder D:\MongoDB\data 2. Right-click cmd.exe under […]

Single-threaded server in Node.js

In order to solve the shortcomings of multi-threaded servers in high-concurrency I/O-intensive applications and avoid the performance obstacles of early simple single-threaded servers, Node.js adopts a non-blocking single-threaded model based on the “event loop” to implement The following two goals: (1) Ensure that each request can be responded to quickly; (2) Achieve the number of […]

Play with the system | node.js version management tool nvm installation and setting detailed process

Recently, I wanted to add a watermark to the pictures in the blog posts, but I didn’t want to use separate software to add watermarks every time. I thought that picgo seemed to have a watermark plug-in, picgo-plugin-watermark, so I installed it excitedly, but when I installed it, I found that… No matter how I […]

Node.JS—npm related

Article directory Preface 1. package.json Configuration items version: 1.0.0 devDependencies dependencies peerDependencies optionalDependencies 2. npm command 1. npm config list xmzs use 2. npm install package-lock.json function 3. npm run 4. View globally installed executable files npm lifecycle npx Introduction to npx npx search command process Advantages The difference between npx and npx npx usage […]

Node.js 21 is here!

2023-10-17 Node.js ushered in a new major version update Node.js 21. I believe some students have already felt that this version upgrade is too fast. I am still using Node.js 10 and the result is 21… Node.js 21 mainly includes the following points: JavaScript engine V8 has been upgraded to 11.8 Stable WebStreams that helps […]

Use Node.js to develop AI applications based on stable diffusion

In this article, we’ll cover how to build a web application that uses ChatGPT and Stable Diffusion to generate a logo and appropriate domain name for any website description you provide. Recommended: Use NSDT editor to quickly build programmable 3D scenes 1. Introduction Artificial intelligence is taking over the world. These technologies are shaking up […]

crypto module for Node.js encryption

The crypto module of Node.js provides many encryption and decryption functions, including symmetric encryption, asymmetric encryption, hash functions, etc. In this article, we will introduce the API, code comments and examples of the Node.js crypto module in detail. Encryption and decryption Symmetric encryption Symmetric encryption algorithms use the same key for encryption and decryption, such […]