Socket
Book a DemoInstallSign in
Socket

@webdav-server/virtual-stored

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webdav-server/virtual-stored

Virtual stored file system for webdav-server

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Virtual Stored File System for webdav-server

webdav-server version 2

npm Version

Allow to keep virtual the resource tree while storing the content of the files in files of a folder. It encrypts the content of the files.

It is more suited for large contents than the VirtualFileSystem.

Install

npm install @webdav-server/virtual-stored

Usage

// TypeScript
import { v2 as webdav } from 'webdav-server'
import * as virtualStored from '@webdav-server/virtual-stored'
// JavaScript
const webdav = require('webdav-server').v2;
const virtualStored = require('@webdav-server/virtual-stored');

const serializer = new virtualStored.VirtualStoredSerializer('password', {
    salt: 'this is the salt of the world',
    cipher: 'aes-256-cbc',
    cipherIvSize: 16,
    hash: 'sha256',
    masterNbIteration: 80000,
    minorNbIteration: 1000,
    keyLen: 256
});

const server = new webdav.WebDAVServer({
    // [...]
    autoLoad: {
        // [...]
        serializers: [
            serializer
            // [...]
        ]
    }
})

const vsfsPath = path.resolve('./data');
fs.mkdir(vsfsPath, (e) => {
    if(e)
        throw e;
    
    serializer.createNewFileSystem(vsfsPath, (e, vsfs) => {
        if(e)
            throw e;
        
        server.setFileSystemSync('/myPath', vsfs, false);
    })
})

server.start((s) => console.log('Ready on port', s.address().port));

Keywords

@webdav-server

FAQs

Package last updated on 28 Aug 2017

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