This is the repository for the nextcloud-link Javascript/Typescript package, written by TenTwentyFour S. à r.l. . We are in no way affiliated to Nextcloud GmbH, but have been explictly allowed us to use the name nextcloud-link for this NPM package.
You can install it from the command-line by doing:
$ npm i nextcloud-link
- Interact with Nextcloud instances with WebDav
- Allows the use of streams for file transfer
- Test Nextcloud connectivity
There is not yet any support for OCS features, which are coming in a later version.
Configures the Nextcloud connection to talk to a specific Nextcloud WebDav endpoint. This does not issue any kind of request, so it doesn't throw if the parameters are incorrect. This merely sets internal variables.
Checks whether the connection to the configured WebDav endpoint succeeds. This does not throw, it consistently returns a Promise wrapping a boolean.
Saves the data obtained through stream to the Nextcloud instance at path.
Throws a NotFoundError if the path to the requested directory does not exist.
Creates a copy of the client that runs the request as the user with the passed credentials.
This does absolutely no verification, so you should use checkConnectivity to verify the credentials.
This is basically a recursive mkdir.
This saves a string at path.
Throws a NotFoundError if the path to the requested directory does not exist.
This allows to rename files or directories.
This allows to move files or entire directories.
Gets a write stream to a remote Nextcloud path.
Throws a NotFoundError if the path to the requested directory does not exist.
Gets a read stream to a remote Nextcloud path.
Smart mkdir implementation that doesn't complain if the folder at path already exists.
List files in a directory.
Removes file or directories. Does not complain if directories aren't empty.
Simple test that checks whether a file or directory exists. This indicates it in the return value, not by throwing exceptions.
Gets a file as a string/Buffer.
Retrieves properties of a file.
Error indicating that the requested resource doesn't exist, or that the path leading to it doesn't exist in the case of writes.
Error indicating that Nextcloud denied the request.
Generic wrapper for the HTTP errors returned by Nextcloud.
interface ConnectionOptions {
url: string;
username?: string;
password?: string;
}