# nestjs-webdav

> Nest - modern, fast, powerful node.js web framework (@webdav)

Latest version **1.0.1** (published 2020-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install nestjs-webdav
pnpm add nestjs-webdav
yarn add nestjs-webdav
bun add nestjs-webdav
```

## 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.1 |
| Published | 2020-04-04 |
| First published | 2020-02-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Sviatoslav H |
| Maintainers | svtslv |
| Keywords | nestjs, webdav, storage, nextcloud |

## Links

- npm: https://www.npmjs.com/package/nestjs-webdav
- Repository: https://github.com/svtslv/nestjs-webdav
- Homepage: https://github.com/svtslv/nestjs-webdav#readme
- Issues: https://github.com/svtslv/nestjs-webdav/issues
- npm.io page: https://npm.io/package/nestjs-webdav

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-04-04
- 1.0.0 — 2020-03-19
- 0.1.2 — 2020-03-18
- 0.1.1 — 2020-03-16
- 0.1.0 — 2020-03-12
- 0.0.3 — 2020-03-06
- 0.0.2 — 2020-02-29
- 0.0.1 — 2020-02-29

## README

# NestJS WebDAV

<a href="https://www.npmjs.com/package/nestjs-webdav"><img src="https://img.shields.io/npm/v/nestjs-webdav.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/package/nestjs-webdav"><img src="https://img.shields.io/npm/l/nestjs-webdav.svg" alt="Package License" /></a>

## Table of Contents

- [Description](#description)
- [Installation](#installation)
- [Examples](#examples)
- [License](#license)

## Description
Integrates WebDAV with Nest

## Installation

```bash
npm install nestjs-webdav webdav
```

You can also use the interactive CLI

```sh
npx nestjs-modules
```

## Examples

### WebDAV-CLI
```bash
npx webdav-cli --username=username --password=password
```

### NextCloud

```bash
docker run \
-e SQLITE_DATABASE=nextcloud \
-e NEXTCLOUD_ADMIN_USER=admin \
-e NEXTCLOUD_ADMIN_PASSWORD=password \
-p 8080:80 \
nextcloud
```

### WebDAVModule.forRoot(options, connection?)

```ts
import { Module } from '@nestjs/common';
import { WebDAVModule } from 'nestjs-webdav';
import { AppController } from './app.controller';

@Module({
  imports: [
    WebDAVModule.forRoot({
      config: {
        endpoint: 'http://127.0.0.1:1900',
        username: 'username',
        password: 'password',
      },
    }),
    WebDAVModule.forRoot({
      config: {
        endpoint: 'http://localhost:8080/remote.php/dav/files/admin/',
        username: 'admin',
        password: 'password',
      },
    }, 'nextCloud'),
  ],
  controllers: [AppController],
})
export class AppModule {}
```

### WebDAVModule.forRootAsync(options, connection?)

```ts
import { Module } from '@nestjs/common';
import { WebDAVModule } from 'nestjs-webdav';
import { AppController } from './app.controller';

@Module({
  imports: [
    WebDAVModule.forRootAsync({
      useFactory: () => ({
        config: {
          endpoint: 'http://127.0.0.1:1900',
          username: 'username',
          password: 'password',
        },
      }),
    }),
    WebDAVModule.forRootAsync({
      useFactory: () => ({
        config: {
          endpoint: 'http://localhost:8080/remote.php/dav/files/admin/',
          username: 'admin',
          password: 'password',
        },
      }),
    }, 'nextCloud'),
  ],
  controllers: [AppController],
})
export class AppModule {}
```

### InjectWebDAV(connection?)

```ts
import { Controller, Get, } from '@nestjs/common';
import { InjectWebDAV, WebDAV } from 'nestjs-webdav';

@Controller()
export class AppController {
  constructor(
    @InjectWebDAV() private readonly webDAV: WebDAV,
    @InjectWebDAV('nextCloud') private readonly nextCloud: WebDAV,
  ) {}

  @Get()
  async getHello() {
    return {
      webdavCli: await this.webDAV.getDirectoryContents('/'),
      nextCloud: await this.nextCloud.getDirectoryContents('/'),
    }
  }
}
```

## License

MIT

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