@adamcikado/flydrive-s3 中文文档教程
flydrive
是一个与框架无关的包,它提供了一个强大的包装器来管理 Node.js 中的文件存储。
此软件包是 Amazon S3 和其他兼容服务的驱动程序。
Getting Started
这个包在 npm 注册表中可用。 它可以通过 npm
或 yarn
轻松安装。
$ npm i @slynova/flydrive-s3
# or
$ yarn add @slynova/flydrive-s3
const { AmazonWebServicesS3Storage } = require('@slynova/flydrive-s3');
const { StorageManager } = require('@slynova/flydrive');
const storage = new StorageManager({
// ...
s3: {
driver: 's3',
config: {
key: process.env.S3_KEY,
endpoint: process.env.S3_ENDPOINT,
secret: process.env.S3_SECRET,
bucket: process.env.S3_BUCKET,
region: process.env.S3_REGION,
},
},
});
storage.registerDriver('s3', AmazonWebServicesS3Storage);
flydrive
is a framework-agnostic package which provides a powerful wrapper to manage file Storage in Node.js.
This package is the driver for Amazon S3 and other compatible services.
Getting Started
This package is available in the npm registry. It can easily be installed with npm
or yarn
.
$ npm i @slynova/flydrive-s3
# or
$ yarn add @slynova/flydrive-s3
const { AmazonWebServicesS3Storage } = require('@slynova/flydrive-s3');
const { StorageManager } = require('@slynova/flydrive');
const storage = new StorageManager({
// ...
s3: {
driver: 's3',
config: {
key: process.env.S3_KEY,
endpoint: process.env.S3_ENDPOINT,
secret: process.env.S3_SECRET,
bucket: process.env.S3_BUCKET,
region: process.env.S3_REGION,
},
},
});
storage.registerDriver('s3', AmazonWebServicesS3Storage);