A React Native module providing native filesystem access for reading, writing, and managing files on iOS, Android, and Windows.
react-native-fs is a React Native library that provides native filesystem access for mobile applications. It allows developers to read, write, copy, move, delete, and manage files and directories on iOS, Android, and Windows devices using a unified JavaScript API. The module solves the problem of handling device storage and file operations in cross-platform React Native apps without relying on platform-specific code.
React Native developers building mobile apps that require local file storage, document handling, media management, or offline data persistence. It's particularly useful for apps dealing with user-generated content, downloads, caching, or file synchronization.
Developers choose react-native-fs for its comprehensive, cross-platform filesystem API that bridges native capabilities with React Native's JavaScript environment. Its key advantages include support for background downloads, asset access, and consistent behavior across iOS, Android, and Windows, eliminating the need for separate platform implementations.
Native filesystem access for react-native
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides unified APIs for iOS, Android, and Windows with constants like DocumentDirectoryPath and MainBundlePath, ensuring consistent file access across platforms as shown in the usage examples.
Supports a wide range of native operations including read, write, move, copy, delete, uploads, and downloads, with promise-based methods detailed in the API section for robust file management.
Includes background downloads on iOS with resumable capabilities and progress tracking, as evidenced by the downloadFile options and background downloads tutorial in the README.
Allows access to Android assets and res folders, and iOS Camera Roll assets, with specific methods like readFileAssets and copyAssetsFileIOS for seamless media integration.
Installation requires different manual steps for iOS, Android, and Windows, with version-specific notes (e.g., RN < 0.57 vs. >= 0.61), making setup tedious and error-prone.
Some methods behave differently by platform, such as copyFile overwriting on Android and Windows but throwing errors on iOS if the file exists, as noted in the API, leading to potential bugs.
Android support is initially restricted to DocumentDirectoryPath per the usage section, requiring additional configuration for broader storage access, which can hinder apps needing external file management.