Download next.js/packages/next/src/build/is-writeable.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 226 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/build/is-writeable.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/build/is-writeable.ts
-
curl -L -o is-writeable.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/build/is-writeable.ts
226 Bytes
| 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 | |
| } | |
| } | |