New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@basicserver/fs-backend

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@basicserver/fs-backend

Add filesystem access via HTTP requests

1.1.5
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

FsBackend

Add filesystem access via HTTP requests

Frontend functions are available here

Usage

import setupFs from '@basicserver/fs-backend';
import Express from 'express';
import Path from 'path';

const App = Express();

setupFs(App, {
    getFilePath(req, path) {
        return Path.join('/path/to/data/', path);
    }
});

/* add routing here */

API

MethodActionBodyContent-Type HeaderDescription
GET/file/abc.txtundefinedno such headerReads the file
GET/dir/abcundefinedno such headerLists directory contents
PUT/file/abc.txt{"content": "Hello!"}application/jsonWrites the file
PUT/dir/abcundefinedno such headerCreates directory recursively
DELETE/file/abcundefinedno such headerDeletes the item recursively
POSTcopyfile{"src": ..., "dest": ...}application/jsonCopies from src to dest
POSTmovefile{"src": ..., "dest": ...}application/jsonMoves from src to dest

FAQs

Package last updated on 29 Jul 2023

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