# owncloud_webdav_js

> a nodejs module for accessing owncloud service via webdav protocol

Latest version **1.0.4** (published 2021-03-18) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install owncloud_webdav_js
pnpm add owncloud_webdav_js
yarn add owncloud_webdav_js
bun add owncloud_webdav_js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-03-18 |
| First published | 2021-02-17 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 55.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jason yang |
| Maintainers | jasonyangshadow |
| Keywords | nodejs, webdav, owncloud |

## Links

- npm: https://www.npmjs.com/package/owncloud_webdav_js
- Repository: https://github.com/JasonYangShadow/owncloud_webdav_js
- Homepage: https://github.com/JasonYangShadow/owncloud_webdav_js#readme
- Issues: https://github.com/JasonYangShadow/owncloud_webdav_js/issues
- npm.io page: https://npm.io/package/owncloud_webdav_js

## Dependencies (6)

- [nedb](https://npm.io/package/nedb.md) ^1.8.0
- [yargs](https://npm.io/package/yargs.md) ^16.2.0
- [webdav](https://npm.io/package/webdav.md) ^4.0.0
- [md5-file](https://npm.io/package/md5-file.md) ^5.0.0
- [properties-reader](https://npm.io/package/properties-reader.md) ^2.2.0
- [console-table-printer](https://npm.io/package/console-table-printer.md) ^2.8.1

## Recent versions

- 1.0.4 (latest) — 2021-03-18
- 1.0.3 — 2021-03-18
- 1.0.2 — 2021-03-16
- 1.0.1 — 2021-03-16
- 1.0.0 — 2021-02-17

## README

# owncloud_webdav_js
A nodejs module for accessing owncloud instance via webdav protocol, you can search, upload, and download packages from owncloud using pure js

To manage the existing packages on owncloud, this module employs nedb to save all manipulations. The package related info includes 'package name', 'package version', 'package type'

You have to provide the url address of owncloud instance, user name, as well as app password for the user to complete the request.

you can install the core compoenents by:

```js
npm i owncloud_webdav_js
```

Examples:
1. search pkg
```js
//require owncloud
const ocloud= require('owncloud');
//initialize client with url, user, pass(app pass)
const oc = new ocloud.Client(url, user, pass);
//search pkg with name
oc.search(pkg).then(data => {console.log(data)}).catch(e => console.error(e));
```

2. search specific pkg
```js
//require owncloud
const ocloud= require('owncloud');
//initialize client with url, user, pass(app pass)
const oc = new ocloud.Client(url, user, pass);
//search pkg with specific properties, pkg name, version ,type(Docker, Singularity, OCI, LPMX and etc)
oc.searchpkg(pkg, ver, type).then(data => {console.log(data)}).catch(e => console.error(e));
```

3. search pkg with condition
```js
//require owncloud
const ocloud= require('owncloud');
//initialize client with url, user, pass(app pass)
const oc = new ocloud.Client(url, user, pass);
//initialize client with url, user, pass(app pass)
oc.searchregx(pkg, ver, type, op).then(data => {console.log(data)}).catch(e => console.error(e));
```

4. download pkg
```js
//require owncloud
const ocloud= require('owncloud');
//initialize client with url, user, pass(app pass)
const oc = new ocloud.Client(url, user, pass);
//downoad pkg with pkg name, version, type, target lacation
oc.download(pkg, ver, type, location).then(data => {console.log(data)}).catch(e => console.error(e));
```

5. upload pkg
```js
//require owncloud
const ocloud= require('owncloud');
//initialize server with url, user, pass(app pass)
const os = new ocloud.Server(url, user, pass);
//upload pkg and set its properties, location => the target pkg being uploaded, overwrite => whether overwritting existing record
os.uploadpkg(pkg, ver, type, location, overwrite).then(data => {console.log(data)}).catch(e =>{
    console.error(e);
});
```

6. delete pkg 
```js
//require owncloud
const ocloud= require('owncloud');
//initialize server with url, user, pass(app pass)
const os = new ocloud.Server(url, user, pass);
//delete pkg with properties
os.deletepkg(pkg, ver, type).then(data => {console.log(data)}).catch(e =>{
    console.error(e);
});
```

The app.js file inside this repository provides a basic CLI program for accessing these features. You can directly call the program with the following commands:

For example:
```js
node app.js search --url=url --user=user --pass=password --pkg=package_name
```
For details, you can use help commands:
```js
node app.js --help
```

## Notice:
There are also executables available on the github repository
[https://github.com/JasonYangShadow/owncloud_webdav_js](https://github.com/JasonYangShadow/owncloud_webdav_js)

---
_Source: https://npm.io/package/owncloud_webdav_js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
