提示区块
example - 代码示例
💻 配置示例
---
title: 我的博客文章
date: 2025-01-15
category: Development
tags: [Git, DevOps]
excerpt: "文章内容的简洁描述..."
---
区块内的高级格式
提示区块内的代码区块
🔧 Git 配置
设置你的 Git 身份:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
提示区块内的表格
💡 端口范围
| 操作系统 | 范围 | 数量 | |---|---|---| | Linux | 32768-60999 | 28232 | | Windows | 49152-65535 | 16384 | | macOS | 49152-65535 | 16384 |
嵌套格式
❌ 常见陷阱
避免这些错误:
-
硬编码路径
// ❌ 不好 const path = 'C:\\Users\\neo\\file.txt';// ✅ 好
const path = require(‘path’).join(__dirname, ‘file.txt’);
-
缺少错误处理
- 总是使用 try-catch 块
- 验证用户输入
- 正确记录错误
-
忽略 async/await
回调函数会导致"回调地狱"。使用现代异步模式。