@codebrew/nestjs-storage

中文文档
0.1.7发布于 2022/08/22MIT零依赖近 30 天下载 5713

Nestjs file system wrapping flydrive

原始使用文档
文档目录5 节
  1. Installation
  2. Example
  3. Support
  4. Stay in touch
  5. License

Nest Logo

nestjs-storage is manage file Storage wrapping package flydrive

NPM Version Package License NPM Downloads

Installation

$ npm i --save @codebrew/nestjs-storage @slynova/flydrive

# optional with s3 driver
$ npm i --save @slynova/flydrive-s3

# optional with gcs driver
$ npm i --save @slynova/flydrive-gcs

Example

// app.module.ts
import { Module } from '@nestjs/common'
import { StorageModule, DriverType, StorageService } from '@codebrew/nestjs-storage';

@Module({
  imports: [
    StorageModule.forRoot({
      default: 'local',
      disks: {
        local: {
          driver: DriverType.LOCAL,
          config: {
            root: process.cwd(),
          },
        },
      },
    }),
  ],
})
export class AppModule {
  constructor(private storage: StorageService) {
    this.storage.getDisk().put('test.txt', 'text content');
  }
}

Support

nestjs-storage is an MIT-licensed open source project. If this library is helpful, please click star to support it.

Stay in touch

License

nestjs-storage is MIT licensed.

版本与发布记录

@codebrew/nestjs-storage 共发布 7 个版本,首次发布于 2020/07/24;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.7latest2022/08/224 年前
0.1.62021/12/134 年前
0.1.52021/10/015 年前
0.1.42020/08/176 年前
0.1.32020/07/316 年前
0.1.22020/07/296 年前

关于 @codebrew/nestjs-storage 的常见问题

@codebrew/nestjs-storage 是什么?

Nestjs file system wrapping flydrive

如何安装 @codebrew/nestjs-storage?

在项目目录运行 npm install @codebrew/nestjs-storage,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@nestjs/common(^6.10.0 || ^7.0.0 || ^8.0.0 || ^9.0.0)、reflect-metadata(^0.1.13)、@slynova/flydrive(^1.0.2)、@slynova/flydrive-gcs(^1.0.2)、@slynova/flydrive-s3(^1.0.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@codebrew/nestjs-storage 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/codebrew__nestjs-storage 是否存在。

@codebrew/nestjs-storage 可以商用吗?

@codebrew/nestjs-storage 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@codebrew/nestjs-storage 的下载量有多少?

根据 npm 官方下载统计,@codebrew/nestjs-storage 在 2026/10/10 – 2026/11/08 这 30 天内被下载 5,713 次,日均约 190 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@codebrew/nestjs-storage 还在维护吗?

最新版本 0.1.7 发布于 2022/08/22(4 年前);至今共发布 7 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/07/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。