![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
NODEJS
准备重写nodejs专栏,希望对大家有用。
dongmelon
抟扶摇直上九万里
展开
-
手写 Bitmap
【代码】手写 Bitmap。原创 2023-02-12 16:27:15 · 203 阅读 · 0 评论 -
typescript泛型
我们平常是对值编程,而泛型是对类型编程 一、初识泛型 1.1keyof 1.2in 1.3infer 1.4Partial 1.5Required 1.6Readonly 1.7Record 1.8Pick 1.9extends 1.10 Exclude 1.11Extract 1.12 Omit 二、类型 2.1联合类型 满足其中之一的类型就可以了。 interface NAS { host: string; port: number;...原创 2022-05-25 23:06:25 · 342 阅读 · 0 评论 -
koa-compose重点解析
源码: return function (context, next) { // last called middleware # let index = -1 return dispatch(0) function dispatch (i) { if (i <= index) return Promise.reject(new Error('next() called multiple times')) index = i原创 2022-05-23 23:13:02 · 189 阅读 · 0 评论 -
手写Promise
class MyPromise { PENDING = 'pending' FULFILLED = 'fulfilled' REJECTED = 'rejected' status = null value = null resolveCallbacks = [] rejectCallbacks = [] constructor(executor) { this.status = this.PENDING .原创 2022-04-17 12:45:58 · 180 阅读 · 0 评论 -
ESM(ESModule)和CJS(CommonJS)
目录 一、ESM 1.1 import 1.2 export 二、CJS 2.1 require 2.2 exports 和 module.exports 一、ESM 1.1 import 1.2 export 二、CJS 2.1 require 2.2 exports 和 module.exports原创 2022-03-20 23:24:57 · 493 阅读 · 0 评论