New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nestjs-webdav

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-webdav

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

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
24
-57.89%
Maintainers
1
Weekly downloads
 
Created
Source

NestJS WebDAV

NPM Version Package License

Table of Contents

Description

Integrates WebDAV with Nest

Installation

npm install nestjs-webdav webdav

You can also use the interactive CLI

npx nestjs-modules

Examples

WebDAV-CLI

npx webdav-cli --username=username --password=password

NextCloud

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

WebDAVModule.forRoot(options, connection?)

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?)

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?)

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

Keywords

nestjs

FAQs

Package last updated on 04 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts