随笔分类 -  npm

摘要:npm config list 查看已经设置的npm配置 https://www.cnblogs.com/luludehuhuan/p/8017014.html 阅读全文
posted @ 2024-07-09 14:30 盘思动 阅读(801) 评论(0) 推荐(0)
摘要:以上是基于一定环境框架的,下面是实测可行的代码: 其中:pm2,node的命令,我都不用找路径,就直接可以执行的,但放crontab中执行还是需要找到路径才可以!!! whereis node,which node来查找安装的路径 不知道 pm2 前面放node是什么意思呢,直接命令执行是不需要的~ 阅读全文
posted @ 2023-03-27 10:18 盘思动 阅读(532) 评论(0) 推荐(0)
摘要:npm包文档: https://www.npmjs.com/package/nprogress/v/0.2.0?activeTab=readme 阅读全文
posted @ 2023-03-24 11:03 盘思动 阅读(88) 评论(0) 推荐(0)
摘要:dot-prop是一个 JavaScript 库,用于处理嵌套对象的属性,它允许您通过点符号(.)访问和修改嵌套对象的属性, 而不需要使用复杂的递归函数或多个if语句来处理。 引入dot-prop库非常简单,可以通过 npm 进行安装: npm install dot-prop 使用dot-prop 阅读全文
posted @ 2023-03-22 16:17 盘思动 阅读(147) 评论(0) 推荐(0)
摘要:安装成功后,需要配置到全局,才可以直接使用pm2命令!! echo $PATH 找到全局环境路径 npm安装的pm2,路径是在nodejs/bin的路径下 截图开始是配置nodejs到全局环境命令的 软链接命令 参考:https://www.likecs.com/show-203632439.htm 阅读全文
posted @ 2023-03-15 09:34 盘思动 阅读(381) 评论(0) 推荐(0)
摘要:d.dlsc = dayjs(d.gxsj).diff(dayjs(d.dlsj), 'second') 阅读全文
posted @ 2022-12-29 13:41 盘思动 阅读(807) 评论(0) 推荐(0)
摘要:var secs_befortime = dayjs().subtract(3000000000,'second').format(); 前言:工作中的经常对时间进行操作处理 ,例如倒计时,距离当前过去了多久等场景,采用原生的时间函数非常不便,本文推荐轻量级的时间处理库 dayjs 进行演示。 一、 阅读全文
posted @ 2022-12-28 13:24 盘思动 阅读(378) 评论(0) 推荐(0)
摘要:console.info(_.random(0, 5)); // => an integer between 0 and 5 console.info(_.random(5)); // => also an integer between 0 and 5 console.info(_.random( 阅读全文
posted @ 2022-12-21 15:37 盘思动 阅读(25) 评论(0) 推荐(0)
摘要:_ = require('lodash'); //var async = require('async'); //var asyncSave = require('asyncSave'); var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n 阅读全文
posted @ 2022-12-21 15:28 盘思动 阅读(96) 评论(0) 推荐(0)
摘要:console.info(_.toArray({ 'a': 1, 'b': 2 })); // => [1, 2] console.info(_.toArray('abc')); // => ['a', 'b', 'c'] console.info(_.toArray(1)); // => [] c 阅读全文
posted @ 2022-12-21 15:15 盘思动 阅读(29) 评论(0) 推荐(0)
摘要:_ = require('lodash'); //var async = require('async'); //var asyncSave = require('asyncSave'); var rearged = _.rearg(function(a, b, c) { return [a, b, 阅读全文
posted @ 2022-12-21 11:23 盘思动 阅读(19) 评论(0) 推荐(0)
摘要:_ = require('lodash'); //var async = require('async'); //var asyncSave = require('asyncSave'); var flipped = _.flip(function() { return _.toArray(argu 阅读全文
posted @ 2022-12-21 11:05 盘思动 阅读(107) 评论(0) 推荐(0)
摘要:_ = require('lodash'); _.delay(function(text) { console.log(text); }, 1000, 'later'); 阅读全文
posted @ 2022-12-21 11:01 盘思动 阅读(297) 评论(0) 推荐(0)
摘要:Why 0.1 + 0.2 = 0.30000000000000004 1.0 - 0.9 = 0.09999999999999998 0.105.toFixed(2) = 0.1 // not 0.11 注意传参传null。会报错 最好数值类型的参数 https://npmmirror.com/p 阅读全文
posted @ 2022-08-08 10:25 盘思动 阅读(310) 评论(0) 推荐(0)
摘要:因为yarn.lock中安装的版本,和package-lock.json中element-ui版本不同所致. ????yarn.lock 中库的版本,不会参考package-lock.json中版本嘛???? https://blog.csdn.net/qq_32881447/article/det 阅读全文
posted @ 2022-07-29 11:22 盘思动 阅读(511) 评论(0) 推荐(0)
摘要:带有^安装,这样可以跟随已经搭建的项目的package.json 中库版本相同,不用变动package.json yarn add package@^1.0.0 npm install package@^1.0.0 yarn add package-1@1.2.3 yarn add package- 阅读全文
posted @ 2022-07-27 09:17 盘思动 阅读(190) 评论(0) 推荐(0)
摘要:通过npm 回到国外资源去下载 nrm 可以到国内下载 npm install nrm -g nrm ls ls是list的缩写,查看下载资源平台 zb@zbdeMacBook-Pro day2 % nrm ls npm https://registry.npmjs.org/ yarn https: 阅读全文
posted @ 2022-07-24 14:04 盘思动 阅读(67) 评论(0) 推荐(0)
摘要:npm模块版本控制 aplha版 - 内测版-功能不全,bug多 beta版 - 公测版-功能不全,存在bug rc版 - 预览版-功能不再增加 stable版- 用户可用 主版本号.次版本号.修改版本号 主版本(#):功能模块有很大的变动,比如增加多个模块或整体架构发生变化 次版本(^):次版本号 阅读全文
posted @ 2022-07-24 13:51 盘思动 阅读(255) 评论(1) 推荐(0)
摘要:serialize/deserialize: 文件被写之前和读之后的操作。 一段代码来解析 const low = require('lowdb'); const FileSync = require('lowdb/adapters/FileSync'); const adapter = new F 阅读全文
posted @ 2022-07-18 14:17 盘思动 阅读(75) 评论(0) 推荐(0)
摘要:安装 yarn add lowdb@1.0.0 --save 操作 const low = require('lowdb'); const FileSync = require('lowdb/adapters/FileSync'); // 有多种适配器可选择 const adapter = new 阅读全文
posted @ 2022-07-18 10:48 盘思动 阅读(475) 评论(0) 推荐(0)