@zenfs/cloud
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ZenFS Cloud

[!WARNING] This package was implemented very recently and may not be stable.

If you find a bug, please report it. Thanks!

This package adds backends for many cloud providers to ZenFS, including:

  • Dropbox
  • Amazon Web Services' S3
  • Google Drive (planned)

For more information, see the API documentation.

[!IMPORTANT] Please read the ZenFS core documentation!

Installing

npm install @zenfs/cloud

Usage

[!NOTE] The examples are written in ESM.
For CJS, you can require the package.
If using a browser environment, you can use a <script> with type=module (you may need to use import maps)

Dropbox

import { configure, fs } from '@zenfs/core';
import { Dropbox } from '@zenfs/cloud';
import { Dropbox as DropboxClient } from 'dropbox';

const client = new DropboxClient({
	accessToken: '...',
	// ...
});

await configure({
	mounts: {
		'/mnt/dropbox': {
			backend: Dropbox,
			client,
		},
	},
});

S3

import { configure, fs } from '@zenfs/core';
import { S3Bucket } from '@zenfs/cloud';
import { S3 } from '@aws-sdk/client-s3';

const client = new S3({
	// ...
});

await configure({
	mounts: {
		'/mnt/s3': {
			backend: S3Bucket,
			bucketName: 'your-bucket',
			client,
		},
	},
});

Readme

Keywords

Package Sidebar

Install

npm i @zenfs/cloud

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

42.6 kB

Total Files

13

Last publish

Collaborators

  • james-pre