MCPcopy Index your code
hub / github.com/Sandpack/nodebox-runtime / readdir

Method readdir

packages/nodebox/src/modules/fs.ts:137–145  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

135 }
136
137 public async readdir(path: string): Promise<string[]> {
138 const response = await this.channel.send('fs/readdir', { path }).catch((error) => {
139 throw new Error(format('Failed to read directory at path "%s"', path), { cause: error });
140 });
141 if (!response) {
142 throw new Error('Directory not found');
143 }
144 return response.data;
145 }
146
147 public async mkdir(path: string, options?: { recursive?: boolean }): Promise<void> {
148 const recursive = !!options?.recursive;

Callers 2

readdirFunction · 0.80

Calls 1

sendMethod · 0.45

Tested by 1

readdirFunction · 0.64