How to use the expo-core.NativeModulesProxy.ExponentFileSystem function in expo-core

To help you get started, we’ve selected a few expo-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / modules / expo-file-system / FileSystem.js View on Github external
// @flow

import { NativeModulesProxy, EventEmitter } from 'expo-core';
import UUID from 'uuid-js';

const FS = NativeModulesProxy.ExponentFileSystem;

const normalizeEndingSlash = p => p.replace(/\/*$/, '') + '/';

FS.documentDirectory = normalizeEndingSlash(FS.documentDirectory);
FS.cacheDirectory = normalizeEndingSlash(FS.cacheDirectory);

export const documentDirectory = FS.documentDirectory;
export const cacheDirectory = FS.cacheDirectory;
export const bundledAssets = FS.bundledAssets;
export const bundleDirectory = FS.bundleDirectory;
export const EncodingTypes = {
  UTF8: "utf8",
  Base64: "base64",
}

type FileInfo =