Browse
dir GET
List the entries of one directory.
const { stat } = await ns.dirAsync({
path: "/123456/images",
actions: { max_entries: "100", prefix: "2026-" },
});
for (const entry of stat.file) console.log(entry.type, entry.name, entry.size);ns.dir("/123456/images", (err, res, body) => {
if (!err) console.log(body?.stat.file.map((f) => f.name));
});npx akamai-netstorage ls images --max-entries 100Signatures
dirAsync(opts: DirListOpts | string): Promise<DirResponse>
dir(opts: DirListOpts | string, callback: (err: any, res?: http.IncomingMessage, body?: DirResponse) => void): void
Parameters
| Name | Type | Description |
|---|---|---|
opts | string | DirListOpts | A path, or { path, actions } with max_entries, prefix, start, end, encoding or slash. |
Returns
DirResponse
{ stat: { attribs: { directory }, file: [{ type, name, size?, md5?, mtime, bytes?, files?, target? }] } }
On the wire
| HTTP method | GET |
| X-Akamai-ACS-Action | version=1&action=dir&format=xml |
| Signed with | X-Akamai-ACS-Auth-Data and X-Akamai-ACS-Auth-Sign (HMAC-SHA256) |
| CLI | akamai-netstorage ls images --max-entries 100 |
Build and sign this request in the playground →
Notes
- All values are strings, as NetStorage returns them.
typeisfile,dirorsymlink.- Each
dircall counts as 10 reads toward NetStorage's rate limits; page through large directories withmax_entries.