This commit is contained in:
Chris Wanstrath 2025-09-28 13:57:24 -07:00
parent 64e76502e8
commit b44c4d10fb

View File

@ -37,6 +37,11 @@ export function isDir(path: string): boolean {
} }
} }
export async function mtime(path: string): Promise<Date> {
const { mtime } = await stat(path)
return mtime
}
// is the given file binary? // is the given file binary?
export async function isBinaryFile(path: string): Promise<boolean> { export async function isBinaryFile(path: string): Promise<boolean> {
// Create a stream to read just the beginning // Create a stream to read just the beginning