Socket
Socket
Sign inDemoInstall

@nephele/adapter-virtual

Package Overview
Dependencies
72
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nephele/adapter-virtual

Virtual resource adapter for the Nephele WebDAV server.


Version published
Weekly downloads
25
increased by400%
Maintainers
1
Install size
6.71 MB
Created
Weekly downloads
 

Changelog

Source

1.0.0-alpha.41 (2024-03-15)

Bug Fixes

  • deleting empty collections in s3 adapter (dd6d10e)

Features

  • add upload queue size option to s3 adapter (2a385d4)

Readme

Source

Virtual File Nephele Adapter

A Nephele adapter that serves virtual files from memory.

Installation

npm i -s @nephele/adapter-virtual

Usage

The default export is the adapter, and it's also a named export "Adapter". Instantiate this class, providing an options object, and give that to Nephele as the adapter.

import express from 'express';
import nepheleServer from 'nephele';
import VirtualAdapter from '@nephele/adapter-virtual';
import ExampleAuthenticator from '@nephele/authenticator-example';

const app = express();
const port = 8080;

app.use(
  '/',
  nepheleServer({
    adapter: new VirtualAdapter({
      files: {
        properties: {
          creationdate: new Date(),
          getlastmodified: new Date(),
          owner: 'root',
        },
        locks: {},
        children: [
          {
            name: "someuser's stuff",
            properties: {
              creationdate: new Date(),
              getlastmodified: new Date(),
              owner: 'someuser',
            },
            locks: {},
            children: [
              {
                name: 'example.txt',
                properties: {
                  creationdate: new Date(),
                  getlastmodified: new Date(),
                  owner: 'someuser',
                },
                locks: {},
                content: Buffer.from('Hello, world.'),
              },
            ],
          },
        ],
      },
    }),
    authenticator: new ExampleAuthenticator(),
  })
);

app.listen(port, () => {
  console.log(`Nephele WebDAV server listening on port ${port}`);
});

If you're using the insecure authenticator, setting the owner of a resource to "nobody" will make it editable. If you're using the PAM authenticator, setting the owner to "root" will make it read-only.

Options / Defaults

  • files: The root file entry to serve from the virtual adapter.

License

Copyright 2022-2024 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Keywords

FAQs

Last updated on 15 Mar 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc