Files
ArtPlayer/scripts/utils.js
T
Harvey Zhao fa2c69e83d feat: add React and Vue examples with Artplayer integration
- Implemented a React template with Vite, including ESLint configuration and necessary dependencies.
- Created a Vue template with Vite, including setup for Artplayer and plugins.
- Added internationalization support in both React and Vue examples.
- Included sample video and Danmuku plugin integration in both frameworks.
- Established project structure with appropriate configuration files and README documentation.
2026-01-03 14:08:31 +08:00

33 lines
768 B
JavaScript

import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import { glob } from 'glob'
export function getProjects() {
return glob
.sync('packages/*')
.sort()
.filter(item => !item.endsWith('artplayer-vitepress'))
.reduce((result, item) => {
const name = item.split(/\/|\\/g).pop()
result[name] = path.resolve(process.cwd(), item)
return result
}, {})
}
export function removeDir(dir) {
if (fs.existsSync(dir)) {
const files = fs.readdirSync(dir)
files.forEach((file) => {
const curPath = path.join(dir, file)
if (fs.statSync(curPath).isDirectory()) {
removeDir(curPath)
}
else {
fs.unlinkSync(curPath)
}
})
fs.rmdirSync(dir)
}
}