blob: 132c42a6e0bdab136a8d2cfb36e7243338fb2387 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
import fs from "fs-extra";
export async function isWriteable(directory: string): Promise<boolean> {
try {
await fs.access(directory, (fs.constants || fs).W_OK);
return true;
} catch (err) {
return false;
}
}
|