wb.ouyang

毕竟几人真得鹿,不知终日梦为鱼

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

随笔分类 -  node.js

1

Error: Cannot find module 'acorn'
摘要:https://blog.csdn.net/yunchong_zhao/article/details/119836038 新版本的webpack-cli 中引入了 这个模块安装下就可以了 cnpm i acorn --save-dev aocrn: 一个用JavaScript编写的小型、快速的Ja 阅读全文

posted @ 2022-01-27 09:15 wenbin_ouyang 阅读(1845) 评论(0) 推荐(1) 编辑

nodejs使用redis实现sub/pub
摘要:1、为了测试,在windows系统安装redis 参考:windows安装解压版redis demo结构: 2、代码 pageage.json { "name": "redis_pub_sub_demo", "version": "1.0.0", "description": "", "main": 阅读全文

posted @ 2020-02-17 14:04 wenbin_ouyang 阅读(797) 评论(0) 推荐(0) 编辑

作图组件react-plotly.js和数据统计组件simple-statistics
摘要:simple-statistics官网:https://simplestatistics.org/docs/#median demo结构: package.json { "name": "react-blank", "version": "0.1.0", "private": true, "depe 阅读全文

posted @ 2020-01-21 18:03 wenbin_ouyang 阅读(1145) 评论(0) 推荐(0) 编辑

npm的chalk包的使用
摘要:使用chalk定义输出样式:Chalk comes with an easy to use composable API where you just chain and nest the styles you want. const chalk = require('chalk') console 阅读全文

posted @ 2020-01-18 22:53 wenbin_ouyang 阅读(1969) 评论(0) 推荐(0) 编辑

npm模块copy-to-clipboard复制内容到剪切板
摘要:import React from 'react' import copy from 'copy-to-clipboard' export default class App extends React.Component { constructor(props) { super(props) th 阅读全文

posted @ 2020-01-18 14:05 wenbin_ouyang 阅读(3277) 评论(0) 推荐(0) 编辑

npm的qs包的使用:stringify()将json对象序列化成表单数据
摘要:console.log(Qs.stringify({id: link, key: secretKey}))输入结果格式;url编码后的 id=64d478c0-3904-11ea-a21e-fdd8236927e9&key=73QjHap%2BX0SR6Erqs%2F4BLQ%3D%3D impor 阅读全文

posted @ 2020-01-17 16:47 wenbin_ouyang 阅读(2074) 评论(0) 推荐(0) 编辑

nodejs获取客户端ip
摘要:1、nodejs //传入请求HttpRequest function getClientIp(req) { return req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.socket.remoteAddre 阅读全文

posted @ 2020-01-07 17:49 wenbin_ouyang 阅读(1078) 评论(0) 推荐(0) 编辑

http-proxy-middleware监听并处理返回数据以及禁用缓存
摘要:1、参考文档1:https://github.com/chimurai/http-proxy-middleware#compatible-servers 2、点开上图链接 https://github.com/http-party/node-http-proxy#listening-for-prox 阅读全文

posted @ 2019-12-27 17:05 wenbin_ouyang 阅读(5177) 评论(2) 推荐(0) 编辑

ubuntu18.04编译安装指定版本nodejs
摘要:https://blog.csdn.net/weixin_34221036/article/details/91421667 阅读全文

posted @ 2019-11-21 20:39 wenbin_ouyang 阅读(506) 评论(0) 推荐(0) 编辑

promise
摘要:// 需求:封装一个方法,给一个读取文件的路径,方法能给我们返回文件内容 const fs = require('fs') const path = require('path') // callback回调:第一个参数错误结果,第二个参数读取的文件内容 function getFileByPath 阅读全文

posted @ 2019-10-03 19:03 wenbin_ouyang 阅读(212) 评论(0) 推荐(0) 编辑

node之events 模块,并通过实例化 EventEmitter 类来绑定和监听事件
摘要:例子来源:http://www.runoob.com/nodejs/nodejs-event-loop.html http://www.runoob.com/nodejs/nodejs-event.html EventEmitter 的每个事件由一个事件名和若干个参数组成,事件名是一个字符串,通常表 阅读全文

posted @ 2019-10-02 16:13 wenbin_ouyang 阅读(371) 评论(0) 推荐(0) 编辑

node.js之CommonJS
摘要:1、CommonJS 我们只是在js文件中写下console.log('This is a test.');这句代码,node.js执行该js文件时: ( function(exports, require, module, __filename, __dirname) { console.log( 阅读全文

posted @ 2019-09-30 20:31 wenbin_ouyang 阅读(238) 评论(0) 推荐(0) 编辑

模板引擎ejs
摘要:1、网站 https://ejs.co/ https://ejs.bootcss.com/ 2、app.js pages/detail.html pages/list.html 阅读全文

posted @ 2019-07-09 19:45 wenbin_ouyang 阅读(165) 评论(0) 推荐(0) 编辑

node.js入门学习(六)--express
摘要:1、官网:http://expressjs.com/ 中文:http://www.expressjs.com.cn/ 2、HelloWorld 1)mkdir node-express-demo 2)cd .\node-express-demo\ 3)新建app.js文件 4)npm init -y 阅读全文

posted @ 2019-07-08 22:22 wenbin_ouyang 阅读(424) 评论(0) 推荐(0) 编辑

node.js入门学习(五)--Demo模块化改造
摘要:1、node.js中模块的分类 1)node.js内置模块(核心,原生) 所有内置模块在安装node.js时就已经编译成二进制文件,可以直接加载运行(速度较快),部分内置模块,在node.exe这个进程启动时就已经默认加载了,可以直接使用。 2)文件模块 require(./common.js); 阅读全文

posted @ 2019-07-07 10:51 wenbin_ouyang 阅读(343) 评论(0) 推荐(0) 编辑

node.js入门学习(四)--Demo图书的增删改查
摘要:需求:图书的增删改查,图书数据保存在data.json文件中。 1、Demo结构: 2、首先下载安装node.js,配置环境变量:参考博客 3、项目初始化 1)创建项目根目录node-hello,进入到根目录node-hello,右键/在此处打开PowerShell窗口。 2)创建app.js文件。 阅读全文

posted @ 2019-07-05 23:11 wenbin_ouyang 阅读(344) 评论(0) 推荐(0) 编辑

underscore的使用
摘要:1、链接 npm underscore:https://www.npmjs.com/package/underscore 官网:https://underscorejs.org/ 2、npm安装:npm install underscore 3、简单使用 阅读全文

posted @ 2019-07-03 22:12 wenbin_ouyang 阅读(791) 评论(0) 推荐(0) 编辑

node.js入门学习(三)--npm
摘要:一、npm介绍 1)npm:node package manager是node.js默认的以js编写的软件包管理系统 官网:www.npmjs.com 文档:docs.npmjs.com 2)提到npm可能指的是: npm这个网站 npm这个js代码仓库 npm客户端 3)npm是node.js默认 阅读全文

posted @ 2019-06-30 18:34 wenbin_ouyang 阅读(185) 评论(0) 推荐(0) 编辑

node.js入门学习(二)MIME模块,request和response对象,demo之不同url请求不同html页面,页面包含图片、样式css等静态资源
摘要:目录:一、构建http服务程序-根据不同请求做出不同响应二、根据用户不同请求,读取不同HTML文件响应三、响应的HTML文件中包含图片的处理方式四、根据后缀查询MIME类型五、案例:不同url请求不同html页面,页面包含图片、样式css等静态资源六、request对象七、response对象常用成 阅读全文

posted @ 2019-06-30 16:32 wenbin_ouyang 阅读(550) 评论(0) 推荐(0) 编辑

node.js入门学习(一)环境安装,REPL,fs模块,path模块,http模块
摘要:目录:一、node.js介绍二、node.js有哪些特点三、下载安装node.js,配置环境变量四、node.js开发网站和传统PHP等开发网站的区别五、REPL介绍六、helloworld程序七、案例:输出一个三角形八、fs写入文件和读取文件九、__dirname和__filename获取正在执行 阅读全文

posted @ 2019-06-29 22:18 wenbin_ouyang 阅读(2080) 评论(0) 推荐(0) 编辑

1
点击右上角即可分享
微信分享提示