egg-minio-ts
v0.0.1
Published
Egg plugin with minio, for oss server.
Downloads
42
Maintainers
Readme
egg-minio-ts
Install
$ npm i egg-minio-ts --save
Usage
// {app_root}/config/plugin.js
exports.minio = {
enable: true,
package: 'egg-minio-ts',
};
Configuration
Database
see config/config.default.ts for more detail.
// {app_root}/config/config.default.ts
exports.minio = {
// For Minio Server (Recommended offline profile.)
...
};
Example
- Service
...
const fileInfo = await this.app.minio.upload(fileStream);
// @ts-ignore
const url = await this.app.minio.getUrl(fileId);
// @ts-ignore
await this.app.minio.delete(fileId);
// @ts-ignore
const fileStream = await this.app.minio.download(fileId);
...
Reference
see minio-js for more detail.
see javascript-client-api-reference for more detail.
Example
Questions & Suggestions
Please open an issue here.