You've already forked Pandona-Engine
初始化提交
This commit is contained in:
26
check_example.js
Normal file
26
check_example.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { readdir, stat } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
|
||||
async function listDirectory(path, indent = 0) {
|
||||
try {
|
||||
const items = await readdir(path);
|
||||
for (const item of items) {
|
||||
const itemPath = join(path, item);
|
||||
const stats = await stat(itemPath);
|
||||
const prefix = ' '.repeat(indent);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
console.log(`${prefix}[DIR] ${item}`);
|
||||
await listDirectory(itemPath, indent + 1);
|
||||
} else {
|
||||
console.log(`${prefix}[FILE] ${item}`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error reading directory ${path}:`, error.message);
|
||||
}
|
||||
}
|
||||
|
||||
// 显示项目中的example目录结构
|
||||
console.log('项目中的example目录结构:');
|
||||
await listDirectory('J:\\git\\cssEngine\\template-example');
|
||||
Reference in New Issue
Block a user