High-performance Node.js-compatible file system (fs) for React Native, powered by Nitro (JSI/C++) for zero-copy binary data handling and near-native speeds.
npm install react-native-nitro-file-systemA high-performance, Node.js-compatible file system (fs) module for React Native, powered by Nitro Modules.

![platform]()
![compatibility]()
δΈζζζ‘£
- π Extreme Performance: Low-overhead communication via JSI and Nitro.
- π¦ Zero-copy Binary Data: Efficiently handle large files using ArrayBuffer and NitroBuffer.
- π οΈ Node.js Compatible API: Supports fs methods like readFile, writeFile, mkdir, stat, and more (Sync & Async).
- ποΈ Streaming Support: Built-in ReadStream and WriteStream for efficient data processing.
- π Directory & Watcher: Support for directory iteration and file system watching.
| Feature | react-native-fs | expo-file-system | react-native-blob-util | Nitro File System |
| :--- | :--- | :--- | :--- | :--- |
| Architecture | Legacy Bridge | Turbo Modules / Expo | Legacy Bridge / C++ | Nitro (JSI / C++) |
| Communication | High (Base64/JSON) | Medium | Medium | Ultra Low (Direct JSI) |
| Binary Handling | Slow (Base64) | Fast | Fast | Top (Zero-copy Buffers) |
| API Style | Custom | Custom | Stream / Mixed | Node.js fs Compatible |
| Sync API | Poor | None | Limited | Full Support |
``sh`
npm install react-native-nitro-file-system react-native-nitro-modules react-native-nitro-bufferor
yarn add react-native-nitro-file-system react-native-nitro-modules react-native-nitro-buffer
| Category | Status | Supported Methods |
| :--- | :--- | :--- |
| File I/O | β
100% | open, read, write, close, readFile, writeFile, appendFile, truncate, fsync, readv, writev |stat
| Metadata | β
100% | , lstat, fstat, access, utimes, futimes, lutimes (including bigint support) |mkdir
| Directories | β
100% | , rmdir, readdir, rm, mkdtemp, opendir (Dir class) |chmod
| Permissions | β
100% | , fchmod, lchmod, chown, fchown, lchown |link
| Links | β
100% | , symlink, readlink, realpath |watch
| Watching | β
100% | , watchFile, unwatchFile |createReadStream
| Streams | β
100% | , createWriteStream |fs.promises.*
| Promises | β
100% | (Full coverage) |
`typescript
import fs from 'react-native-nitro-file-system';
// Write a file (Sync)
fs.writeFileSync('/path/to/file.txt', 'Hello Nitro!');
// Read a file (Async)
fs.readFile('/path/to/file.txt', 'utf8', (err, data) => {
if (err) throw err;
console.log(data); // "Hello Nitro!"
});
// Using Promises
const content = await fs.promises.readFile('/path/to/file.txt', 'utf8');
`
The library supports Android content:// URIs for the following operations:fs.open
- Read/Write: , fs.read, fs.write, fs.readFile, fs.writeFile.fs.stat
- Metadata: , fs.lstat, fs.access (existence check).fs.unlink
- Cleanup: , fs.rm.fs.copyFile
- Utility: .
Note: Directory operations (mkdir, readdir, rename, chmod) are not supported for content:// URIs as they are virtual resources.
`typescript
// Read directly from a content:// URI
const contentUri = 'content://com.android.providers.media.documents/document/image%3A1234';
const data = fs.readFileSync(contentUri, 'base64');
// Get file stats
const stats = fs.statSync(contentUri);
console.log(stats.size);
`
Includes first-class support for iOS bookmark:// URIs, allowing persistent access to security-scoped resources (like iCloud Drive files picked via Document Picker) without copying them.
`typescript
import fs, { getBookmark, resolveBookmark } from 'react-native-nitro-file-system';
// 1. Convert specific path to bookmark
const bookmark = getBookmark('/path/to/file');
// 2. Access using bookmark URI
const stat = await fs.promises.stat(bookmark);
const content = await fs.promises.readFile(bookmark);
// 3. Resolve bookmark back to physical path
const path = resolveBookmark(bookmark);
console.log(path); // "/path/to/file"
``
ISC