- Implemented JimengService for image generation with API integration. - Created OSSService for handling image uploads to S3. - Developed PBService for managing PocketBase interactions. - Added task management for image creation and downloading using BullMQ. - Introduced routes for creating image generation tasks. - Implemented logging and error handling for image processing. - Added configuration management for Redis and other services. - Created scripts for testing image generation and PocketBase integration. - Updated package dependencies and added new scripts for worker management.
21 lines
506 B
TypeScript
21 lines
506 B
TypeScript
import path from 'node:path'
|
|
import fs from 'node:fs'
|
|
import { createStorage } from 'unstorage'
|
|
import fsDriver from 'unstorage/drivers/fs'
|
|
|
|
const storage = createStorage({
|
|
driver: fsDriver({ base: 'storage' }),
|
|
})
|
|
|
|
async function listFiles() {
|
|
const files = await storage.getKeys()
|
|
const first20Files = files.slice(0, 20)
|
|
console.log('前20个文件名:')
|
|
first20Files.forEach((file) => {
|
|
console.log(file)
|
|
})
|
|
}
|
|
|
|
listFiles().catch((err) => {
|
|
console.error('Error listing files:', err)
|
|
}) |