{"id":20151886,"url":"https://github.com/nestcrafts/nestjs-minio","last_synced_at":"2025-05-16T15:07:03.695Z","repository":{"id":36388999,"uuid":"221381081","full_name":"NestCrafts/nestjs-minio","owner":"NestCrafts","description":"Your favorite object storage with nestjs","archived":false,"fork":false,"pushed_at":"2024-11-14T14:46:22.000Z","size":3604,"stargazers_count":83,"open_issues_count":3,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T13:00:27.721Z","etag":null,"topics":["bucket","hacktoberfest","javascript","minio","nest","storage-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NestCrafts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["rubiin"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.buymeacoffee.com/XbgWxt567"]}},"created_at":"2019-11-13T05:39:01.000Z","updated_at":"2025-04-27T15:21:04.000Z","dependencies_parsed_at":"2023-02-12T09:46:06.726Z","dependency_job_id":"8e7b2c2b-f516-4399-be48-5d6e2ec3671d","html_url":"https://github.com/NestCrafts/nestjs-minio","commit_stats":{"total_commits":470,"total_committers":14,"mean_commits":33.57142857142857,"dds":"0.33404255319148934","last_synced_commit":"1147f1243e7669ba817563eb119c732e1544cc27"},"previous_names":["nestcrafts/nestjs-minio"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NestCrafts%2Fnestjs-minio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NestCrafts%2Fnestjs-minio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NestCrafts%2Fnestjs-minio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NestCrafts%2Fnestjs-minio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NestCrafts","download_url":"https://codeload.github.com/NestCrafts/nestjs-minio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bucket","hacktoberfest","javascript","minio","nest","storage-server"],"created_at":"2024-11-13T23:07:46.796Z","updated_at":"2025-05-16T15:07:03.677Z","avatar_url":"https://github.com/NestCrafts.png","language":"TypeScript","funding_links":["https://github.com/sponsors/rubiin","https://www.buymeacoffee.com/XbgWxt567"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"http://kamilmysliwiec.com/public/nest-logo.png#1\" alt=\"Nest Logo\" /\u003e   \u003c/a\u003e\n  \u003ca href=\"https://min.io\" target=\"_blank\"\u003e\u003cimg src=\"https://min.io/resources/img/logo.svg\" width=\"380\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eMinio Module for Nest framework\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/nestjs-minio\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/nestjs-minio\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://img.shields.io/npm/l/nestjs-minio\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/nestjs-minio\" alt=\"Package License\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/nestjs-minio\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/nestjs-minio\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.buymeacoffee.com/XbgWxt567\" target=\"_blank\"\u003e\u003cimg src=\"https://i.imgur.com/CahshSS.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n\n## Description\nThis's a [nest-minio](https://github.com/rubiin/nest-minio) module for [Nest](https://github.com/nestjs/nest).\nThis quickstart guide will show you how to install the client SDK and execute an example JavaScript program. For a complete list of APIs and examples, please take a look at the [JavaScript Client API Reference](https://docs.min.io/docs/javascript-client-api-reference) documentation.\n\nThis document assumes that you have a working [nodejs](http://nodejs.org/) setup in place.\n\n\n## Installation\n\n```bash\n$ npm i --save nestjs-minio\n```\n\n\n## Initialize MinIO Client\n\nYou need five items in order to connect to MinIO object storage server.\n\n\n| Params     | Description |\n| :------- | :------------ |\n| endPoint\t | URL to object storage service. |\n|port| TCP/IP port number. This input is optional. Default value set to ``80`` for HTTP and ``443`` for HTTPs.|\n| accessKey | Access key is like user ID that uniquely identifies your account.   |\n| secretKey\t| Secret key is the password to your account.    |\n|useSSL |Set this value to 'true' to enable secure (HTTPS) access |\n\nProvide the credentials for minio module by importing it as :\n\n```javascript\nimport { Module } from '@nestjs/common';\nimport { NestMinioClientController } from './nest-minio-client.controller';\nimport { NestMinioModule } from '../nest-minio.module';\n\n@Module({\n  controllers: [NestMinioClientController],\n  imports: [\n    NestMinioModule.register({\n      isGlobal: true,\n      endPoint: 'play.min.io',\n      port: 9000,\n      useSSL: true,\n      accessKey: 'Q3AM3UQ867SPQQA43P2F',\n      secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',\n    }),\n  ],\n})\nexport class NestMinioClientModule {}\n\n```\nThen you can use it in the controller or service by injecting it in the controller as:\n\n```javascript\n\n constructor(@Inject(MINIO_CONNECTION) private readonly minioClient) {}\n\n```\n\n## Quick Start Example - File Uploader\nThis example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.\n\nWe will use the MinIO server running at https://play.min.io in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.\n\n```js\n\nimport { Controller, Get, Inject } from '@nestjs/common';\nimport { MINIO_CONNECTION } from '../constants';\nimport {Client, InjectMinio} from 'minio';\n\n@Controller()\nexport class NestMinioClientController {\n // use inject token\n  constructor(@Inject(MINIO_CONNECTION) private readonly minioClient: Client) {}\n\n  // or use inject decorator\n  // constructor(@InjectMinio() private readonly minioClient: Client) {}\n\n  @Get()\n  index() {\n    const file = '/tmp/app.zip';\n\n    const metaData = {\n      'Content-Type': 'application/octet-stream',\n      'X-Amz-Meta-Testing': 1234,\n      example: 5678,\n    };\n    // Using fPutObject API upload your file to the bucket europetrip.\n    this.minioClient.fPutObject(\n      'europetripxxx3',\n      'app.zip',\n      file,\n      metaData,\n      function(err, etag) {\n        if (err) {\n          return console.log(err);\n        }\n        console.log('File uploaded successfully.');\n      },\n    );\n  }\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnestcrafts%2Fnestjs-minio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnestcrafts%2Fnestjs-minio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnestcrafts%2Fnestjs-minio/lists"}