0226e7872a
close #14744 <img width="851" alt="screen_shot" src="https://user-images.githubusercontent.com/39780486/86603491-06bec800-bfdf-11ea-9928-ee85cbad86a7.png"> I have some concerns. - `import { isWriteable } from '../next/build/is-writeable'` **not** from `create-next-app ` package. - The warning sentence is from npm. Not for Next.js. I'm not a native English speaker. I'd like to know the natural expression for this.
10 lines
226 B
TypeScript
10 lines
226 B
TypeScript
import fs from 'fs'
|
|
|
|
export async function isWriteable(directory: string): Promise<boolean> {
|
|
try {
|
|
await fs.promises.access(directory, (fs.constants || fs).W_OK)
|
|
return true
|
|
} catch (err) {
|
|
return false
|
|
}
|
|
}
|