[Source Code Learning--koa] Source Code Interpretation Analysis of Koa Middleware Core (koa-compose)

Recently, Koa has been used frequently for server-side development and has become fascinated with its onion model, which makes it great.And koa is mainly streamlined, there is not a lot of integration, everything needs to be loaded on demand, this is more to my taste. In contrast to express's middleware, express's middleware uses concatenation, ...

Added by darkke on Sun, 14 Jun 2020 19:21:23 +0300

Using tree node cli to generate a tree

When writing a blog, you often need to show the directory structure of the project. My computer is windows, and the tree command is not very effective. If you can use Node, you can use Node! So I found several cross platform ones. namely tree-cli and tree-node-cli These two are one author. Among them, tree node cli is more suitable for Linux us ...

Added by feyd on Thu, 11 Jun 2020 06:20:57 +0300

Log interception of nginx and warehousing practice of shell script

Implemented front end monitoring Understand business access and user distribution Monitor the stability of business customization key nodes (payment, im message, etc.) Monitor business system exceptions (exception details, exception occurrence environment) Monitor business performance (future) Alarm, mail task (future) Written in front This ...

Added by stuworx on Wed, 11 Dec 2019 11:39:42 +0200

nodeJs file system (fs) and stream

File System: In Node, file system interaction is very important. The essence of server is to send local files to client, Node interacts with the file system through fs module, which provides some standard file access API classes to open, read, write files, and interact with them. If you use FS module, first load it from the core module; use co ...

Added by emorr1981 on Mon, 09 Dec 2019 09:18:24 +0200

Implementation of Token authentication mechanism based on jsonwebtoken in egg

Json web token (JWT) is a JSON based development standard (RFC 7519) which is implemented for the purpose of passing statements between network application environments. The token is designed to be compact and secure, especially suitable for SSO scenarios of distributed sites. JWT declaration is generally used to transfer the authenticated user ...

Added by smalband on Tue, 03 Dec 2019 21:29:16 +0200

Using archive to compress files in nodejs

Preface archive is a tool for cross platform packaging in nodejs You can compress the file to zip or rar format It is a better third-party module install npm install archiver --save archive github address: https://github.com/archiverjs/node-archiver Quick Start // require modules var fs = require('fs'); var archiver = require('archiver'); // ...

Added by Dustin013 on Tue, 26 Nov 2019 17:48:33 +0200

Write a web pack loader to get the pictures under the specified directory and return the picture URL array

Preface I often encounter such a problem. When preloading the image resources of h5 project, we often need to manually get one image address and store it in the array, and then pre load the traversal, such as this: let imgList = ['http://domain.com/img/1.jpg','http://domain.com/img/2.jpg','http://domain.com/img/3.jpg',...]; In the spirit of bei ...

Added by JakeTheSnake3.0 on Tue, 05 Nov 2019 17:25:23 +0200

Introduction to Vue VIII. Communication between non parent and child components

Implementation of non parent-child component communication through Bus mechanism1. Create an empty instance (Bus central event Bus can also be called intermediate component)2. Use $emit $on to trigger and listen to events to realize the communication between non parent and child componentsBefore using this.$bus.$on to transfer values between c ...

Added by jack_ on Mon, 04 Nov 2019 02:09:55 +0200

http module and fs module

Article link: http module and fs module http module responseObject common methods: response.writeHead(200,{'Content-Type':'text/plain:charset=UTF-8'}); This method can only be called once on a message and must be calledresponse.end()Before calling. response.write()Send a corresponding body to send the corresponding data to the client.writeI ...

Added by nrsh_ram on Fri, 01 Nov 2019 21:44:00 +0200

How to do the front end of a large factory? Baidu senior front-end engineer, take you to write the micro front-end framework

Preface Focus on the core implementation and skip to the fourth section: execution process. The commands in this article apply only to shell enabled systems, such as Mac, Ubuntu, and other linux distributions. It is not applicable to windows. If you want to execute the commands in the article under windows, please use git command window (GIT ne ...

Added by wiztek2000 on Thu, 31 Oct 2019 05:05:51 +0200