react常用模块介绍

react

react各个模块:


1、node.js自带的模块(原生模块):https://www.jianshu.com/p/abc72267abfc
原生模块的api文档地址:http://nodejs.cn/api/
怎么判断引用的模块是核心模块(自带)还是文件模块(npm另安装)?
node 内核是提供了判断的方法的,比如你的例子的 crypto 模块
// true
process.binding('natives').hasOwnProperty('crypto');
// false
process.binding('natives').hasOwnProperty('express');

可以通过 process.moduleLoadList 打印的 NativeModule 可以查看到相关的模块信息

https://juejin.im/post/5afd4cca51882542ab4a2066

核心模块是 Nodejs将其编译成二进制的模块,便于更快速加载
核心模块存放在 Node.js 源代码的 lib/ 目录下。
require() 总是会优先加载核心模块。 例如,require('http') 始终返回内置的 HTTP 模块,即使有同名文件。

Javascript模块化编程(一/二/三):模块的写法:http://www.ruanyifeng.com/blog/2012/10/javascript_module.html


2、express-http-proxy代理中间件
Express middleware to proxy request to another host and pass response back to original caller.
https://www.jianshu.com/p/846e8b555ead
https://github.com/villadora/express-http-proxy#readme

http-proxy-middleware解决跨域问题changeOrigin:true
https://github.com/chimurai/http-proxy-middleware
3、cookie-parser赋予express解析cookie的能力
https://github.com/expressjs/cookie-parser
4、body-parser赋予express解析body的能力
https://github.com/expressjs/body-parser
5、morgan express的日志插件,可以控制web访问日志的格式、输出等
https://github.com/expressjs/morgan

6、express-ws:websocket
https://github.com/HenningM/express-ws
sockjs-client:客户端连接
https://github.com/sockjs/sockjs-client
7、webpack-node-externals:不要绑定某些模块
When bundling with Webpack for the backend - you usually don't want to bundle its node_modules dependencies. This library creates an externals function that ignores node_modules when bundling in Webpack.
8、assets-webpack-plugin 资源打包插件
https://github.com/ztoben/assets-webpack-plugin

9、lodash 是一个一致性、模块化、高性能的 JavaScript 实用工具库。
https://www.lodashjs.com/

10、clean-webpack-plugin:A webpack plugin to remove/clean your build folder(s) before building
https://www.npmjs.com/package/clean-webpack-plugin
11、copy-webpack-plugin:Copies individual files or entire directories to the build directory
https://www.npmjs.com/package/copy-webpack-plugin
12、babel-plugin-import:https://www.npmjs.com/package/babel-plugin-import

13、rotating-file-stream 日志存储更新设置:大小限制、每天更新等

https://www.npmjs.com/package/rotating-file-stream

以上是 react常用模块介绍 的全部内容, 来源链接: utcz.com/z/382336.html

回到顶部