Browse
stat GET
Get details of a file or directory.
const { stat } = await ns.statAsync("/123456/static/app.js");
const [file] = stat.file;
console.log(file.size, file.md5);ns.stat("/123456/maybe.txt", (err, res, body) => {
if (res?.statusCode === 404) console.log("not found");
});npx akamai-netstorage stat static/app.jsSignatures
statAsync(ns_path: string): Promise<StatResponse>
stat(ns_path: string, callback: (err: any, res?: http.IncomingMessage, body?: StatResponse) => void): void
Parameters
| Name | Type | Description |
|---|---|---|
ns_path | string | NetStorage path. |
Returns
StatResponse
{ stat: { attribs: { directory }, file: [{ type, name, mtime, size?, md5? }] } }
On the wire
| HTTP method | GET |
| X-Akamai-ACS-Action | version=1&action=stat&format=xml |
| Signed with | X-Akamai-ACS-Auth-Data and X-Akamai-ACS-Auth-Sign (HMAC-SHA256) |
| CLI | akamai-netstorage stat static/app.js |
Build and sign this request in the playground →
Notes
- A missing path returns HTTP 404; use the callback form to read the status code.