Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
The Vega File System API provides support for enabling file system querying, traversing, reading, and writing operations.

Remarks

Apps operate in a sandboxed environment with a restricted view of the device file system. Vega makes the following app-specific directories available in the sandbox.

Get started

Setup

  1. Add the following library dependency to the dependencies section of your package.json file.
  2. Regenerate the package-lock.json file using the npm install command.

Usage

The following examples use async/await to handle Promises returned by FileSystem methods. This pattern provides a cleaner way to work with asynchronous operations.

Open a file

This example uses async/await to handle the Promise returned by FileSystem.openFile().

Remove a file

This example uses async/await to handle the Promise returned by FileSystem.removeFile().

Remove a directory

This example uses async/await to handle the Promise returned by FileSystem.removeDir().

Remove a directory recursively

This example uses async/await to handle the Promise returned by FileSystem.removeDirAll().

Read a file as a string

This example uses async/await to handle the Promise returned by FileSystem.readFileAsString().

Write a string to a file

This example uses async/await to handle the Promise returned by FileSystem.writeStringToFile().

Access file metadata

This example uses async/await to handle the Promise returned by FileSystem.getMetadata().

Access directory entries

This example uses async/await to handle the Promise returned by FileSystem.getEntries().

Modules


Last modified on February 19, 2026