Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to read temp file in windowsnodejs

	async function getFiles(dir) {
		const dirents = await fs.readdir(dir, { withFileTypes: true })
		console.log(dirents)

		const files = await Promise.all(
			dirents.map((dirent) => {
				const res = path.resolve(dir, dirent.name)
				return dirent.isDirectory() ? getFiles(res) : res
			})
		)
		return Array.prototype.concat(...files)
	}
 
PREVIOUS NEXT
Tagged: #read #temp #file #windowsnodejs
ADD COMMENT
Topic
Name
8+8 =