# fs

Safe, typed wrappers around Node.js synchronous filesystem APIs with structured error handling.

Covers four areas: reading ([`readFileContent`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-readFileContent), [`readFileBuffer`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-readFileBuffer), [`readJsonFile`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-readJsonFile), plus `*IfExists` variants), writing ([`writeFileContent`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-writeFileContent), [`writeJsonFile`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-writeJsonFile), [`ensureDir`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-ensureDir), automatically creates parent directories), directory operations ([`readDirectory`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-readDirectory), [`readDirectoryRecursive`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-readDirectoryRecursive), [`createDirectory`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-createDirectory), [`removeDirectory`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-removeDirectory)), and stat/traversal helpers ([`exists`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-exists), [`isFile`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-isFile), [`isDirectory`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-isDirectory), [`isSymlink`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-isSymlink), [`findUpwardWhere`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-findUpwardWhere), [`locateByMarkers`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-locateByMarkers), [`traverseUpward`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-traverseUpward)).

All operations surface failures via [`createFileSystemError`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-createFileSystemError) with codes ([`FS_NOT_FOUND`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-FileSystemErrorCode), [`FS_READ_ERROR`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-FileSystemErrorCode), [`FS_WRITE_ERROR`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-FileSystemErrorCode), [`FS_PARSE_ERROR`](https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/#api-FileSystemErrorCode)) carrying contextual paths.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs/
This file: https://www.hyperfrontend.dev/docs/libraries/project-scope/core/fs.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
