https://github.com/rangermauve/random-access-rn-file
A random-access-* compatible implementation for React-Native that uses it's filesystem
https://github.com/rangermauve/random-access-rn-file
Last synced: 3 months ago
JSON representation
A random-access-* compatible implementation for React-Native that uses it's filesystem
- Host: GitHub
- URL: https://github.com/rangermauve/random-access-rn-file
- Owner: RangerMauve
- License: mit
- Created: 2019-02-27T21:31:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-28T22:20:49.000Z (about 6 years ago)
- Last Synced: 2025-02-14T06:19:02.214Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# random-access-rn-file
A random-access-* compatible implementation for React-Native that uses it's filesystem```
npm install --save random-access-rn-file# If you're building an application
# Link the FS APIs
react-native link react-native-fs# Make node modules work (Make sure to import shim.js)
npm install --save-dev rn-nodeify
rn-nodeify --install --hack
```Uses [random-access-storage](https://github.com/random-access-storage/random-access-storage) along with [react-native-fs](https://github.com/itinance/react-native-fs/) to provide the ability to read and write files.
After installing, make sure to run `react-native link react-native-fs` to set up the native dependencies
Supported operations:
- `read`
- `write`## Example
```javascript
import hyperdrive from 'hyperdrive'
import storage from 'random-access-rn-file'const archive = hyperdrive(storage)
archive.writeFile('/example.txt', 'Hello World', 'utf8')
```If you're having trouble getting node APIs to work in React-Native, check out [rn-nodeify](https://github.com/tradle/rn-nodeify) to see if it helps, or [open an issue](https://github.com/RangerMauve/random-access-rn-file/issues/new).