会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
starlog
yume
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
6
7
8
9
10
11
12
13
下一页
2021年2月20日
JavaScript异步
摘要: 在项目根目录有files文件夹和index.js,在files文件夹里有a.json、b.json、c.json三个文件,要按顺序获取它们的内容 index.js: const fs = require('fs') const path = require('path') // 按顺序获取文件内容
阅读全文
posted @ 2021-02-20 14:03 starlog
阅读(54)
评论(0)
推荐(0)
2021年2月19日
vscode选中当前页面所有相同文本
摘要: 勾选要选中的文本,按 Ctrl + Shift + L ,然后编辑文本
阅读全文
posted @ 2021-02-19 14:07 starlog
阅读(300)
评论(0)
推荐(0)
Git提示文件名过长无法提交
摘要: 在项目根目录: git config core.longpaths true 问题解决
阅读全文
posted @ 2021-02-19 13:25 starlog
阅读(401)
评论(0)
推荐(0)
Git使用.gitignore过滤文件的过滤规则
摘要: 过滤文件夹: node_modules/ 过滤文件: demo.html 过滤全部具有某种后缀名的文件: *.zip 跟踪文件夹: !src/ 跟踪文件: !index.html 跟踪全部具有某种后缀名的文件: !*.js 示例: .DS_Store node_modules/ dist/ npm-
阅读全文
posted @ 2021-02-19 12:26 starlog
阅读(567)
评论(0)
推荐(0)
Git提交代码时使用.gitignore过滤node_modules文件夹
摘要: 在项目根目录启动cmd 新建.gitignore文件: type nul> .gitignore 使用vscode打开.gitignore文件 code .gitignore 输入以下内容并保存 node_modules/ 这样以后就不会提交node_modules文件夹了 删除本地仓库提交过的no
阅读全文
posted @ 2021-02-19 12:02 starlog
阅读(472)
评论(0)
推荐(0)
2021年2月18日
使用Git把本地项目上传到GitHub
摘要: 先在GitHub创建对应的仓库 在项目根目录配置.gitignore文件: Git提交代码时使用.gitignore过滤node_modules文件夹 Git使用.gitignore过滤文件的过滤规则 在项目根目录: git init git add . 或 git add * git commit
阅读全文
posted @ 2021-02-18 17:50 starlog
阅读(69)
评论(0)
推荐(0)
node删除非空文件夹
摘要: // 要删除非空文件夹,需要先把文件夹里的文件删除,再删除空文件夹 function removeDir(path) { let data = fs.readdirSync(path); //data是一个数组,文件夹名和文件名用引号括起来,如["1", "2.txt", "3.html"] for
阅读全文
posted @ 2021-02-18 14:23 starlog
阅读(664)
评论(0)
推荐(0)
2021年2月17日
安装并使用nodemon
摘要: 安装nodemon: npm i nodemon -g
阅读全文
posted @ 2021-02-17 18:51 starlog
阅读(96)
评论(0)
推荐(0)
2021年2月15日
JavaScript中的this取值问题
摘要: 一、this调用的各种情况: 1.作为普通函数被调用(this引用Window对象) 2.使用call、apply、bind(传入什么,this就绑定什么) 3.作为对象方法被调用(this引用对象本身,谁调用就是谁) 4.在class方法中调用(this引用当前实例本身) 5.在箭头函数中被调用(
阅读全文
posted @ 2021-02-15 22:58 starlog
阅读(306)
评论(0)
推荐(0)
ES2020按需导入模块
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
posted @ 2021-02-15 14:27 starlog
阅读(124)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
下一页
公告