Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
由于项目使用了ESLint和Supervisor,请先执行下面的
npm本地工具
。慕课网实战视频教程:https://coding.imooc.com/class/package/146.html
1. 管理文件
2. 自动打开管理页面
3. 兼容macos和windows
4. 多种命令参数可选
5. 缓存方案
1. npm i -g netfile # 把当前文件夹当作静态资源服务区根目录
2. netfile -p 8080 # 设置端口号
3. netfile -h localhost # 设置主机ip
4. netfile -d /usr/ # 设置跟目录为/usr
5. netfile -c # 是否使用缓存方案
1. npm i -g eslint,supervisor
2. npm i -g babel-eslint -D
1. Stream(fs/http)
2. Express/Koa/egg
3. child_process/Cluster集群
4. through2
5. SSR/同构
6. NodeJS源码
1. 每个文件都是一个模块,有自己的作用域;
2. 在模块内部,module 变量代表模块本身;
3. module.exports 属性代表模块对外提供的接口
1. / 表示根目录绝对路径,./ 表示当前文件所在目录;
2. 支持 js,json,node 拓展名,不写则依次尝试;
3. 不写路径则认为该模块是 nodeJS 内建模块或向上各级 node_module 下第三方模块
1. module 被加载的时候执行,加载后缓存;
2. 如果某个模块被循环依赖,就只输出已执行的部分,未执行的部分不会输出;
3. node_modules 并没有把子依赖放在依赖包的原因是为了提高性能
exports是 module.exports 的快捷方式, 如 const exports = module.exports;
注意exports的指向问题,不能修改。因为exports指向的永远是moudle.exports
1. fsUpdate.readFile/fsUpdate.readFileSync
2.
3.
1. CommonJS,Buffer,Process,Console,Timer,SetImmediate;
2. global.xxx相当于直接把xxx暴露给所有模块;
3. 模块中直接写const是局部变量,写global是全局变量
4. global.setImmediate(() => {xxx})事件队列执行顺序(3)
1. process可以获取主机环境的各种信息;
2. process.nextTick(() => {xxx})事件队列执行顺序(1)
3. setTimeout(() => {xxx})事件队列执行顺序(2)
1.
2.
3.
1. __dirname和__filename总是返回文件的绝对路径
2. process.cwd()总是返回node命令所在的文件夹
3. 在require方法中总是相对当前文件所在文件夹
4. 在其他地方和process.cwd()一样,相对node启动文件夹
1. Buffer用于处理二进制数据流
2. 实例类似整数数组,大小固定(0-255十六进制)
3. C++代码在V8引擎堆外分配物理内存
1.
2.
3.
1. 引入 util.promisify 处理异步回调
2. 异步方法使用 const xxx = promisify(zzz.xxx) 转为同步方法
3. 异步方法调用前使用 await 关键字
1. 匹配模式前加 / 代表项目根目录
2. 匹配模式最后加 / 代表是目录
3. 匹配模式前加 ! 代表取反
4. * 代表任意字符,? 代表匹配一个字符, ** 代表匹配多级目录
1. 每次git commit会验证ESlint规则并自动修复一部分内容
2. 自动修复不了的内容会报错,需要手动修改后再次commit
1. npm i -g supervisor pm2
2. 修改服务端代码不需要重启node程序了
1. 安装:npm i handlebars
1. Expires / Cache-Control
2. If-Modified / Last-Modified
3. If-None-Match / ETag
1. yargs和commander的对比
2.
3.
1.
2.
3.
FAQs
Node Action in iMooc
We found that netfile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.