
nodejs
西张明-辉
用过的语言有: PHP, nodeJs, c#, java(kotlin)
展开
-
【node数字笔记】
i++和++i的区别原创 2022-05-11 15:50:10 · 448 阅读 · 0 评论 -
【百元买百鸡】
百元买百鸡原创 2022-04-12 16:00:53 · 178 阅读 · 0 评论 -
nodejs导出excel
导出示例主要导出备份代码主要导出备份代码import {Context as KatoContext} from 'kato-server';import {Request, Response} from 'express';//用于该项目的特定context,项目中任何使用kato context的地方都应该使用该context类export class Context extends KatoContext { //http请求,默认是express的 req: Request |原创 2021-01-14 15:18:57 · 859 阅读 · 0 评论 -
nodejs函数reduce
函数reduce的应用reduce 累加reduce的应用参数是否必须说明<参数1>prev必须初始值, 或者计算结束后的返回值<参数2>current必须当前元素<参数3>index可选当前元素的索引<参数4>array可选当前元素所属的数组对象reduce 累加累加值,从0开始const systemScore = ruleList.reduce( (prev, curr) =&g原创 2021-01-14 14:50:06 · 972 阅读 · 0 评论 -
node笔记之发送邮件
邮件示例nodemailer发送邮件安装模块正文代码nodemailer发送邮件安装模块npm install nodemailer正文代码以qq邮箱为例授权码获取: 打开qq邮箱 => 点设置 => 点账户 => 往下拉找到 POP3/SMTP服务 => 开启import {createTransport, TransportOptions} from 'nodemailer';async sendEmail() { const transporter原创 2020-12-18 13:41:17 · 320 阅读 · 0 评论 -
node笔记之find
node笔记之findfindfindIndexfindfind() 方法返回数组中满足条件的第一个元素的值。否则返回 undefined。// 一维数组const array = [5, 12, 8, 130, 44];const number = array.find(item => item > 10);console.log(number);// 12// 二维数组const list = [ {code: 'hospital', name: '机构'},原创 2020-12-04 14:04:50 · 1206 阅读 · 0 评论 -
nodejs函数filter
函数filterfilter去重filter过滤reduce的应用reduce 累加filterfilter去重//利用filter去重let r = [];let arr = ['apple', 'strawberry', 'banana','pear', 'apple', 'orange', 'orange', 'strawberry']; r = arr.filter(function (element, index, self){ return self.indexOf(ele原创 2020-12-01 17:25:40 · 4778 阅读 · 0 评论 -
map的应用笔记
map的简单应用map往数组中添加元素map往数组中添加元素// 原数组let list = [{code:'hospitalA',name:'医院A'},{code:'hospitalB',name:'医院B'}]// 往数组中追加元素const newList = list.map(it => ({ ...it, children: []}));// 执行后list = [ {code:'hospitalA',name:'医院A',children:[]}, {cod原创 2020-12-01 10:33:00 · 118 阅读 · 0 评论 -
nodejs基于SequelizeDocs开发笔记
基于SequelizeDocs开发笔记查询model页面示例查询logging:console.log能打印出sql// in 查询const systemHospital = await CheckHospitalModel.findAll({ where: { hospital: { [Op.in]: hospitalIdList } }, logging: console.log});// 模糊查询const hospitals = awai原创 2020-12-01 10:22:34 · 166 阅读 · 0 评论 -
nodejs函数之数组篇
nodejs基础总结之数组篇数组函数数组去重排序reduce应用filter应用map的应用数组函数// 数组对象arrayObject.slice(start,end) 方法可从已有的数组中返回选定的元素。// 合并数组list1.concat(list2)// 数组拆分array.join(',')// 去除重复checkArr = Array.form(new Set(checkIdArr))从数组 添加/删除项目(3个参数)list1.splice(index:必须 整原创 2020-11-27 17:42:52 · 2210 阅读 · 0 评论 -
初学node笔记之Mac
初学node笔记之Mac章快捷键快捷键webStorm中的git快捷键command T git更新代码(pull)command K 提交(commit)command + shift + K 推送代码(push)webStorm的应用command + shift + 上下 移动这一行shift + fn + F6 替换所有用到的变量...原创 2020-11-27 13:52:04 · 157 阅读 · 0 评论 -
初学nodejs笔记
nodejs菜鸟开发克隆项目基于git开发克隆项目// git clone 项目路径git clone https://github.com/mohui/1407C.git// 下载完执行下 npm cinpm ci原创 2020-11-27 10:16:59 · 117 阅读 · 0 评论 -
nodejs时间函数
nodejs基础总结uuid方法moment时间函数应用uuid方法npm install uuid --saveimport uuid from "uuid";uuid.v1();uuid.v4();moment时间函数应用// 格式化时间 moment('2017-09-01').format('YYYYMMDD')// 当前时间 moment().format('YYYY-MM-DD HH:mm:ss');// 当前时间now = moment();// 格式化结束原创 2020-11-26 10:53:24 · 2108 阅读 · 0 评论 -
nodejs函数之字符串篇
nodejs基础总结字符串函数数组函数数组去重排序reduce应用filter应用字符串函数// 字符串分割成数组 string.split('');// 数组变成字符串 array.join(',');// 将字符串str中的字符都转换为大写str.toUpperCase()// 将字符串str中的字符都转换为小写str.toLowerCase()findIndex() 方法返回传入一个测试条件(函数)符合条件的数组第一个元素位置,可以用于复杂数据类型。indexOf()原创 2020-11-26 13:48:33 · 4240 阅读 · 0 评论