上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: 在项目根目录有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 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 勾选要选中的文本,按 Ctrl + Shift + L ,然后编辑文本 阅读全文
posted @ 2021-02-19 14:07 starlog 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 在项目根目录: git config core.longpaths true 问题解决 阅读全文
posted @ 2021-02-19 13:25 starlog 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 过滤文件夹: node_modules/ 过滤文件: demo.html 过滤全部具有某种后缀名的文件: *.zip 跟踪文件夹: !src/ 跟踪文件: !index.html 跟踪全部具有某种后缀名的文件: !*.js 示例: .DS_Store node_modules/ dist/ npm- 阅读全文
posted @ 2021-02-19 12:26 starlog 阅读(552) 评论(0) 推荐(0) 编辑
摘要: 在项目根目录启动cmd 新建.gitignore文件: type nul> .gitignore 使用vscode打开.gitignore文件 code .gitignore 输入以下内容并保存 node_modules/ 这样以后就不会提交node_modules文件夹了 删除本地仓库提交过的no 阅读全文
posted @ 2021-02-19 12:02 starlog 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 先在GitHub创建对应的仓库 在项目根目录配置.gitignore文件: Git提交代码时使用.gitignore过滤node_modules文件夹 Git使用.gitignore过滤文件的过滤规则 在项目根目录: git init git add . 或 git add * git commit 阅读全文
posted @ 2021-02-18 17:50 starlog 阅读(63) 评论(0) 推荐(0) 编辑
摘要: // 要删除非空文件夹,需要先把文件夹里的文件删除,再删除空文件夹 function removeDir(path) { let data = fs.readdirSync(path); //data是一个数组,文件夹名和文件名用引号括起来,如["1", "2.txt", "3.html"] for 阅读全文
posted @ 2021-02-18 14:23 starlog 阅读(642) 评论(0) 推荐(0) 编辑
摘要: 安装nodemon: npm i nodemon -g 阅读全文
posted @ 2021-02-17 18:51 starlog 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 一、this调用的各种情况: 1.作为普通函数被调用(this引用Window对象) 2.使用call、apply、bind(传入什么,this就绑定什么) 3.作为对象方法被调用(this引用对象本身,谁调用就是谁) 4.在class方法中调用(this引用当前实例本身) 5.在箭头函数中被调用( 阅读全文
posted @ 2021-02-15 22:58 starlog 阅读(296) 评论(0) 推荐(0) 编辑
摘要: <!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 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页