https://github.com/lywzx/node-js-filesystem
node js filesystem like laravel filesystem
https://github.com/lywzx/node-js-filesystem
flysystem node-js-filesystem
Last synced: 11 months ago
JSON representation
node js filesystem like laravel filesystem
- Host: GitHub
- URL: https://github.com/lywzx/node-js-filesystem
- Owner: lywzx
- License: mit
- Created: 2020-03-12T16:03:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-27T21:06:42.000Z (almost 3 years ago)
- Last Synced: 2025-08-13T05:26:10.359Z (11 months ago)
- Topics: flysystem, node-js-filesystem
- Language: TypeScript
- Homepage: https://www.lyblog.net
- Size: 3.14 MB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About Node Js Filesystem
[](https://github.com/lywzx/node-js-filesystem/actions/workflows/npm-ci.yml)
[](https://codecov.io/gh/lywzx/node-js-filesystem)
[](https://www.npmjs.com/package/@filesystem/core)
[](https://www.npmjs.com/package/@filesystem/core)
[](https://snyk.io/test/github/lywzx/node-js-filesystem?targetFile=package.json)
[](https://www.npmjs.com/package/@filesystem/core)
Node js filesystem like php filesystem package [thephpleague/flysystem](https://flysystem.thephpleague.com/)
Flysystem is a filesystem abstraction library for NodeJs. By providing a unified interface for many different filesystems you’re able to swap out filesystems without application wide rewrites.
Using Flysystem can eliminate vendor-lock in, reduce technical debt, and improve the testability of your code.
# Getting Started
## Installation
```bash
# install
yarn add @filesystem/core # or:npm install @filesystem/core --save
```
# Support Adapters
Adapters | Status | Description
---|---|---
@filesystem/ali-oss-adapter | doing | aliyun oss adapter, support nodejs or browser
@filesystem/ftp-adapter | doing | nodejs ftp upload
@filesystem/sftp-adapter | doing | sftp adapter
@filesystem/webdav-adapter | doing | webdav adapter
@filesystem/memory-adapter | doing | memory filesystem adapter
@filesystem/nestjs | doing | NestJs Module
# Usage
To safely interact with the filesystem, always wrap the adapter in a Filesystem instance.
```typescript
import { LocalFilesystemAdapter, Filesystem } from '@filesystem/core';
// SETUP
const adapter = new LocalFilesystemAdapter(rootPath);
const filesystem = Filesystem(adapter);
// USAGE
await filesystem.write($path, $contents);
```