转自:https://blog.csdn.net/m0_67392126/article/details/126113751 https://blog.csdn.net/qq_44787816/article/detai…
分类:Node
【转载】npm run dev 的时候究竟做了什么
转自 https://blog.csdn.net/web2022050901/article/details/125165316 引言 npm run dev命令应该是我们工作当中最常使用的命令,但是具体是如何运行的相信…
【转载】npm和yarn的区别,该如何选择?
转自:https://www.jianshu.com/p/254794d5e741 同事让我熟悉基于React的新项目。 按照以往,我的步骤都是: git clone xxx npm install npm…
Node.js通过npm -g安装之后的位置
C:\Users\Administrator\AppData\Roaming\npm\node_modules
node.js中exports和module.exports的区别 转
转自:https://blog.csdn.net/qq_31967569/article/details/82461499 module.exports 对象是由模块系统创建的。在我们自己写模块的时候,需要在模块最后写好…
node.js q模块详解 转
转自:https://zhuanlan.zhihu.com/p/26437904
Node.js中的一些常用模块
object-hash 生成哈希值 let hash = require('object-hash'); let testJson = {"name":"Jack","sex":"male"}; let jsonHash…
npm install --save-dev和--save的区别 转
转自:https://www.cnblogs.com/blackgan/p/7678868.html package.json中两个字段含义简介 一直在使用npm包管理器,对于npm install module --s…
Node.js压缩和解压缩 转
转自:http://t.zoukankan.com/xbblogs-p-9156446.html 推荐一个极其简单、及其好用的node.js的压缩和解压缩类库 compressing 支持格式: tar、gzip、tg…
利用npm 安装删除模块 转
转自:https://www.cnblogs.com/arxive/p/10313690.html 1. npm安装模块 【npm install xxx】利用 npm 安装xxx模块到当前命令行所在目录; 【npm i…
Node.js中axios的使用 转
转自:https://www.cnblogs.com/itech/p/13253319.html http相关modules HTTP – the Standard Library Request Axios Super…
node express 设置跨域访问
const express = require("express"); const app = express(); //设置跨域访问 app.all("*",function(req,res,next){ //设置允许…
node.js 限定ip
/********************加入ip访问控制Start*********************/ let AccessControl = require('express-ip-access-contro…
nodejs处理xlsx文档 转
转自:https://www.cnblogs.com/liuyinlei/p/7267040.html 1.读取xlsx 文件依赖包:multiparty,XLSX,代码如下: var multiparty = requ…
node-xlsx 读写 excel 转
转自:https://www.cnblogs.com/article-record/p/12762496.html 安装 Node 模块 npm install node-xlsx 读取文件 let list = xls…
记一次由BOM引起的bug 转
转自:https://segmentfault.com/a/1190000012086435 bug 今天团队小伙伴给了我一个json配置文件,可以用如下替代(毕竟内容不是重点): { "text": "this is …
Node.js 文件去BOM
// 去除BOM头 stripBom = function(filePath){ let buff = fs.readFileSync(filePath); if (buff[0].toString(16…
Node.js中文件下载进度获取 转
转自:https://www.cnblogs.com/ybixian/p/12296205.html 原文:https://www.jianshu.com/p/36cc5042ef12 /** * 文件下载 * @par…
node.js throw er; // Unhandled 'error' event错误原因
events.js:141 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE :::9000 at Object.…
node.js项目加入Windows服务 转
转自:http://mrdede.com/?p=1126 使用模块 node-windows npm官网: https://www.npmjs.com/package/node-windows github官网: htt…
获取Post参数的两种方式 转
转自:https://www.cnblogs.com/lpxj-blog/p/10673441.html 一、关于POST请求 post方法作为http请求很重要的一部分,几乎所有的网站都有用到它,与get不同,post…
使用express框架,在ejs文件中导入外部的js、css文件 转
转自:https://cloud.tencent.com/developer/article/1415294 最近在用nodejs写一点东西,当然也用到了express框架和ejs模版了。在使用ejs模版的过程中遇到了这…
node.js文件下载
// 文件下载 app.get('/download/*', function(req, res, next) { let filePath = req.params[0]; // 获取download后面的参数…
node.js 多文件上传 转
转自:https://www.mizuiren.com/479.html 文件上传对于网站来说意义非凡,今天来挖挖nodejs上传文件的完整功能,支持多文件批量上传以及讲解相关技术点和注意事项。 文件上传我们一般使用fo…
node.js 图片压缩 转
转自:https://zhuanlan.zhihu.com/p/93882055?from_voters_page=true 图片压缩,在很多地方都用的到,是种实用性很高的技术方案。 NodeJS中进行图片压缩,可以选择…
node Excel模块xlsx的使用方法 转
转自:https://www.jianshu.com/p/7d2e584cbcc1 npm i xlsx -S 读取数据 let xlsx = require('xlsx'); let workbook = xlsx.r…
理解CommonJS、AMD、CMD三种规范 转
转自:https://zhuanlan.zhihu.com/p/26625636 前言 这三个规范都是为Js模块化加载而生的,使模块能够按需加载,使系统同庞杂的代码得到组织和管理。模块化的管理代码使多人开发得到了更好的合…
CommonJS的模块规范 转
转自:https://www.cnblogs.com/tianxintian22/p/5084870.html CommonJS对模块的定义十分简单,主要分为模块引用、模块定义和模块标识。 1、模块引用 var math…
node.js中JSZip的使用 转
转自:https://www.jianshu.com/p/f6d53d44dcbe JSZip 是一个用于创建、读取和编辑.zip文件的JavaScript库,且API的使用也很简单。如下是使用 JSZip 压缩一个文件…
js node.js获取文件名
获取文件后缀:const fileExt = path.extname(filename); // 获取文件后缀 获取文件名称不包括后缀:filename.split(".")[0]; 另外一种获取文件名称…