as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support

KeplerFileSystem

Interface for the Kepler FileSystem TurboModule.

This is the interface contains basic methods to manipulate the contents of the local filesystem. It makes querying into the file system, traversing it, reading and writing to files possible.

Extends

  • KeplerTurboModule

Properties

getConstants()?

readonly optional getConstants: () => object

Returns

object

Inherited from

KeplerTurboModule.getConstants


getEntries()

getEntries: (path) => Promise<string[]>

Gets directory entries for the given path.

Parameters

path

string

The path to the directory.

Returns

Promise<string[]>

The promise that resolves with the directory entries.


getMajorVersion()

readonly getMajorVersion: () => number

Returns

number

Inherited from

KeplerTurboModule.getMajorVersion


getMetadata()

getMetadata: (path, noFollow) => Promise<Metadata>

Gets metadata about the file or symbolic link referred to by path.

Parameters

path

string

The path to the file.

noFollow

boolean

defines whether stat or lstat is used.

Returns

Promise<Metadata>

The promise that resolves with the metadata.


getMinorVersion()

readonly getMinorVersion: () => number

Returns

number

Inherited from

KeplerTurboModule.getMinorVersion


getPatchVersion()

readonly getPatchVersion: () => number

Returns

number

Inherited from

KeplerTurboModule.getPatchVersion


openFile()

openFile: (path, mode) => Promise<void>

Opens a file with the specified mode.

Parameters

path

string

The path of the file to open.

mode

OpenMode

The mode to open the file in.

Returns

Promise<void>

The promise that resolves when the file is opened.


readFileAsString()

readFileAsString: (path, encoding) => Promise<string>

Reads the entire content of a text file into a string.

Parameters

path

string

The path to the file.

encoding

string

The encoding to use when reading the file.

Returns

Promise<string>

The promise that resolves with the file content.


removeDir()

removeDir: (path) => Promise<void>

Deletes a directory at the path.

Parameters

path

string

The path of the directory to delete.

Returns

Promise<void>

The promise that resolves when the directory is deleted.


removeDirAll()

removeDirAll: (path) => Promise<void>

Deletes a directory at the path and all its content.

Parameters

path

string

The path of the directory to delete.

Returns

Promise<void>

The promise that resolves when the directory is recursively deleted.


removeFile()

removeFile: (path) => Promise<void>

Deletes a file at the path.

Parameters

path

string

The path of the file to delete.

Returns

Promise<void>

The promise that resolves when the file is deleted.


writeStringToFile()

writeStringToFile: (path, content, encoding) => Promise<number>

Writes a string to a text file.

Parameters

path

string

The path to the file.

content

string

The string content to write.

encoding

string

The encoding to use when writing the file.

Returns

Promise<number>

The promise that resolves with the number of bytes written.


Last updated: Sep 30, 2025