[title: "NodeDirectoryEntry Class"] ← Back to index

Cordova DirectoryEntry equivalent for Node.js

[heading: "Description"]

NodeDirectoryEntry provides a Cordova-compatible DirectoryEntry interface on top of Node.js synchronous file system calls. It is used by NodeFileSystem so that addon and song code can interact with directories identically across Cordova and NW.js platforms.

[heading: "Key Features"] [list] * Mimics the Cordova DirectoryEntry API for NW.js environments * Supports directory creation, recursive removal, and file listing * Bridges Node.js fs operations to Cordova-style callbacks [/list] [heading: "Constructor"] [table header] [ Parameter | Type | Description ] [ name | string | The directory name ] [ fullPath | string | The relative path from the filesystem root ] [ fileSystem | NodeFileSystem | The parent NodeFileSystem instance ] [ nativeURL | string | The native file:// URL for this directory ] [/table] [heading: "Example Usage (Modding)"] [codeblock javascript] // Listing subdirectories through a NodeDirectoryEntry const fs = new NodeFileSystem(); const root = await fs.getDirectory('Songs/'); const reader = root.createReader(); reader.readEntries((entries) => { entries.filter(e => e.isDirectory).forEach(dir => { console.log('Found directory:', dir.name); }); }, (err) => console.error(err)); [/codeblock] [footer: "© Retora 2026"]