Connection settings. hostname, keyName and key are required;
ssl defaults to false; proxy is an optional http(s):// proxy URL.
Deletes a file or symlink (delete action).
Full path of the file.
Receives the error, the HTTP response and the parsed body.
Deletes a file or symlink (delete action).
Full path of the file.
Lists a directory (dir action).
Directory path, or { path, actions } with DirOpts.
Receives the error, the HTTP response and the parsed body.
Lists a directory (dir action).
Directory path, or { path, actions } with DirOpts.
The parsed listing: body.stat.attribs.directory and body.stat.file[].
Downloads a file to the local disk.
NetStorage file path (not a directory).
Local file or directory. Pass "" (or omit it in JavaScript) to use the
NetStorage file name in the current directory; a directory keeps the NetStorage file name.
Receives the error, the HTTP response and { message: "Download Done." }.
Check res.statusCode: the response body is written to disk whatever the status.
Downloads a file to the local disk.
NetStorage file path (not a directory).
Local file or directory. Pass "" to use the NetStorage file name in the
current directory; a directory keeps the NetStorage file name.
{ message: "Download Done." }. The response body is written whatever the HTTP status;
use Netstorage.download if you need the status code.
Downloads a file into memory.
NetStorage file path (not a directory).
Receives the error, the HTTP response and { buffer, message }.
At runtime body.buffer holds the bytes as a binary (latin1) string; convert it with
Buffer.from(body.buffer as unknown as string, "binary") for a real Buffer.
Downloads a file into memory.
NetStorage file path (not a directory).
{ buffer, message }. At runtime buffer holds the bytes as a binary (latin1) string;
convert it with Buffer.from(result.buffer as unknown as string, "binary") for a real Buffer.
Disk usage of a directory (du action).
NetStorage directory path.
Receives the error, the HTTP response and the parsed body.
Disk usage of a directory (du action).
NetStorage directory path.
body.du["du-info"][0] with files and bytes (as strings).
Lists files recursively under a path (list action).
Path, or { path, actions } with ListOpts.
Receives the error, the HTTP response and the parsed body.
Lists files recursively under a path (list action).
Path, or { path, actions } with ListOpts.
body.list.file[], plus body.list.resume[0].start when more entries remain.
Creates a directory (mkdir action).
Full path of the directory to create.
Receives the error, the HTTP response and the parsed body.
Creates a directory (mkdir action).
Full path of the directory to create.
Sets the modification time of a file (mtime action).
NetStorage file path.
Unix time in seconds (no milliseconds).
Receives the error, the HTTP response and the parsed body.
Sets the modification time of a file (mtime action).
NetStorage file path.
Unix time in seconds (no milliseconds).
Deletes a directory and everything in it (quick-delete action).
Quick delete must be enabled on the CP code by Akamai.
Full path of the directory.
Receives the error, the HTTP response and the parsed body.
Deletes a directory and everything in it (quick-delete action).
Quick delete must be enabled on the CP code by Akamai.
Full path of the directory.
Renames or moves a file (rename action).
Current path.
New path.
Receives the error, the HTTP response and the parsed body.
Renames or moves a file (rename action).
Current path.
New path.
Removes an empty directory (rmdir action).
Full path of the directory.
Receives the error, the HTTP response and the parsed body.
Removes an empty directory (rmdir action).
Full path of the directory.
File or directory metadata (stat action).
NetStorage path.
Receives the error, the HTTP response and the parsed body.
File or directory metadata (stat action).
NetStorage path.
body.stat.file[0] with type, name, mtime (and size, md5 for files).
Creates a symbolic link (symlink action).
Existing file the link points to.
Path of the new link.
Receives the error, the HTTP response and the parsed body.
Creates a symbolic link (symlink action).
Existing file the link points to.
Path of the new link.
Uploads a local file (upload action).
Path of the local file.
NetStorage file path, or a directory ending in / to keep the local file name.
Receives the error, the HTTP response and { message: "Request Processed." } on success.
Uploads a local file (upload action).
Path of the local file.
NetStorage file path, or a directory ending in / to keep the local file name.
{ message: "Request Processed." } on success.
Uploads a Buffer (upload action), e.g. a generated file that never touches the disk.
File contents.
File name used when ns_destination ends in /.
NetStorage file path, or a directory ending in /.
Receives the error, the HTTP response and { message: "Request Processed." } on success.
Uploads a Buffer (upload action), e.g. a generated file that never touches the disk.
File contents.
File name used when ns_destination ends in /.
NetStorage file path, or a directory ending in /.
{ message: "Request Processed." } on success.
Client for the Akamai NetStorage HTTP API.
Every operation comes in two forms: a callback method (
stat,upload, ...) that receives(err, response, body), and a promise method with anAsyncsuffix (statAsync,uploadAsync, ...) that resolves with the parsed body.Example