{"id":46676687,"url":"https://github.com/tacxou/nestjs_module_factorydrive-s3","last_synced_at":"2026-03-08T23:04:41.327Z","repository":{"id":195965067,"uuid":"694064380","full_name":"tacxou/nestjs_module_factorydrive-s3","owner":"tacxou","description":"S3 driver for Factory drive module from NestJS framework","archived":false,"fork":false,"pushed_at":"2026-03-07T13:01:19.000Z","size":347,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-07T19:25:49.776Z","etag":null,"topics":["abstract","abstraction","async","bucket","decorators","disk","drive","driver","factory","factorydrive","file","filesystem","nestjs","node","nodejs","npm","promise","s3","spaces","storage"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@tacxou/nestjs_module_factorydrive-s3","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tacxou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-20T09:02:21.000Z","updated_at":"2026-03-07T13:01:23.000Z","dependencies_parsed_at":"2024-06-19T19:24:09.111Z","dependency_job_id":"e0310850-cec5-4f82-9097-7e340581e34e","html_url":"https://github.com/tacxou/nestjs_module_factorydrive-s3","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"ad4655823de22fc04dae5ad2a2535268525ae2a0"},"previous_names":["streamkits/nestjs_module_factorydrive-s3","the-software-compagny/nestjs_module_factorydrive-s3","tacxou/nestjs_module_factorydrive-s3"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tacxou/nestjs_module_factorydrive-s3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tacxou%2Fnestjs_module_factorydrive-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tacxou%2Fnestjs_module_factorydrive-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tacxou%2Fnestjs_module_factorydrive-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tacxou%2Fnestjs_module_factorydrive-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tacxou","download_url":"https://codeload.github.com/tacxou/nestjs_module_factorydrive-s3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tacxou%2Fnestjs_module_factorydrive-s3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30273292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["abstract","abstraction","async","bucket","decorators","disk","drive","driver","factory","factorydrive","file","filesystem","nestjs","node","nodejs","npm","promise","s3","spaces","storage"],"created_at":"2026-03-08T23:04:40.908Z","updated_at":"2026-03-08T23:04:41.322Z","avatar_url":"https://github.com/tacxou.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\n    \u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  S3 driver for Factory drive module from NestJS framework\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/org/tacxou\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@tacxou/nestjs_module_factorydrive-s3.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/org/tacxou\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@tacxou/nestjs_module_factorydrive-s3.svg\" alt=\"Package License\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tacxou/nestjs_module_factorydrive-s3/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/tacxou/nestjs_module_factorydrive-s3/actions/workflows/ci.yml/badge.svg\" alt=\"Publish Package to npmjs\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/tacxou/nestjs_module_factorydrive\"\u003e\u003cimg src=\"https://codecov.io/gh/tacxou/nestjs_module_factorydrive/graph/badge.svg?token=KK6LY0DZ4p\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tacxou/nestjs_module_factorydrive-s3/actions/workflows/release.yml?event=workflow_dispatch\"\u003e\u003cimg alt=\"GitHub contributors\" src=\"https://github.com/tacxou/nestjs_module_factorydrive-s3/actions/workflows/release.yml/badge.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n# S3 driver for Factory drive module\nS3 storage driver for [`@tacxou/nestjs_module_factorydrive`](https://www.npmjs.com/package/@tacxou/nestjs_module_factorydrive), built for NestJS.\n\n## Features\n- Amazon S3-compatible implementation of `AbstractStorage`\n- Common file operations (`put`, `get`, `copy`, `move`, `delete`, `exists`)\n- Stream and buffer support for downloads/uploads\n- Signed URL generation via AWS SDK v3\n- Flat listing with automatic pagination (`listObjectsV2`)\n- Domain exceptions mapping from S3 errors\n\n## Requirements\n- Node.js `\u003e= 22`\n- Bun `\u003e= 1` (for local scripts/tests in this repository)\n- A configured S3 bucket (AWS S3 or S3-compatible endpoint)\n\n## Installation\nInstall the Factory Drive core module and this S3 driver:\n\n```bash\nnpm install @tacxou/nestjs_module_factorydrive @tacxou/nestjs_module_factorydrive-s3\n```\n\n```bash\nyarn add @tacxou/nestjs_module_factorydrive @tacxou/nestjs_module_factorydrive-s3\n```\n\n```bash\npnpm add @tacxou/nestjs_module_factorydrive @tacxou/nestjs_module_factorydrive-s3\n```\n\n```bash\nbun add @tacxou/nestjs_module_factorydrive @tacxou/nestjs_module_factorydrive-s3\n```\n\n## Quick start (NestJS)\nRegister the driver class in your app startup:\n\n```ts\nimport { Module } from '@nestjs/common'\nimport { FactorydriveService } from '@tacxou/nestjs_module_factorydrive'\nimport { AwsS3Storage } from '@tacxou/nestjs_module_factorydrive-s3'\n\n@Module({\n  // ...\n})\nexport class AppModule {\n  public constructor(storage: FactorydriveService) {\n    storage.registerDriver('s3', AwsS3Storage)\n  }\n}\n```\n\n## Driver configuration\nThe constructor accepts `AmazonWebServicesS3StorageConfig`, which extends AWS `S3ClientConfig` and adds:\n\n- `bucket` (string, required): target bucket name\n\nExample:\n\n```ts\nimport { AwsS3Storage } from '@tacxou/nestjs_module_factorydrive-s3'\n\nconst storage = new AwsS3Storage({\n  bucket: 'my-app-bucket',\n  region: 'eu-west-1',\n  credentials: {\n    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,\n    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,\n  },\n})\n```\n\nFor S3-compatible providers (MinIO, DigitalOcean Spaces, etc.), pass your custom endpoint/options through standard AWS SDK `S3ClientConfig`.\n\n## Available methods\n\n### Write / update\n- `put(location, content)`: upload string, `Buffer`, or readable stream\n- `copy(src, dest)`: copy object within the bucket\n- `move(src, dest)`: copy then delete source\n- `delete(location)`: delete object (`wasDeleted` is `null`, raw response is exposed)\n\n### Read\n- `get(location, encoding?)`: returns file content as text\n- `getBuffer(location)`: returns file content as `Buffer`\n- `getStream(location)`: returns a readable stream\n- `getStat(location)`: returns `{ size, modified, raw }`\n- `exists(location)`: checks object existence\n- `flatList(prefix?)`: async iterator over all object keys (paginated)\n- `getSignedUrl(location, options?)`: temporary signed GET URL (default `expiresIn = 900` seconds)\n\n## Error handling\nKnown S3 errors are converted into Factory Drive exceptions:\n\n- `NoSuchBucket` -\u003e `NoSuchBucketException`\n- `NoSuchKey` -\u003e `FileNotFoundException`\n- `AllAccessDisabled` -\u003e `PermissionMissingException`\n- any other error -\u003e `UnknownException`\n\nThis keeps error handling consistent with the rest of the Factory Drive ecosystem.\n\n## Example usage\n```ts\nawait storage.put('documents/invoice.txt', 'hello world')\n\nconst { exists } = await storage.exists('documents/invoice.txt')\nif (exists) {\n  const file = await storage.get('documents/invoice.txt')\n  console.log(file.content)\n}\n\nconst signed = await storage.getSignedUrl('documents/invoice.txt', { expiresIn: 60 })\nconsole.log(signed.signedUrl)\n```\n\n## Development\nUseful scripts:\n\n- `bun test`: run tests\n- `bun test --coverage --coverage-reporter lcov`: run coverage\n- `bun run build`: build package\n\nCI runs tests (with coverage upload) and build on pushes/PRs.\n\n## Compatibility\n- Peer dependency: `@tacxou/nestjs_module_factorydrive@^1.0.0`\n- TypeScript peer dependency: `^5.0.0`\n\n## Security\nPlease read [`SECURITY.md`](./SECURITY.md) before reporting vulnerabilities.\n\n## License\nMIT, see [`LICENSE`](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftacxou%2Fnestjs_module_factorydrive-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftacxou%2Fnestjs_module_factorydrive-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftacxou%2Fnestjs_module_factorydrive-s3/lists"}