Skip to content
A random-access-* compatible implementation for React-Native that uses it's filesystem
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package.json

README.md

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 along with 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

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 to see if it helps, or open an issue.

You can’t perform that action at this time.