{"id":36970353,"url":"https://github.com/omnipin/filebase-upload","last_synced_at":"2026-01-13T21:47:26.937Z","repository":{"id":208912452,"uuid":"722748081","full_name":"omnipin/filebase-upload","owner":"omnipin","description":"💾 Minimal library to upload files on Filebase S3 API. Partially based on AWS SDK v3.","archived":false,"fork":false,"pushed_at":"2025-12-30T01:45:57.000Z","size":142,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-02T09:59:14.814Z","etag":null,"topics":["filebase","ipfs","s3"],"latest_commit_sha":null,"homepage":"https://npm.im/@stauro/filebase-upload","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omnipin.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":null,"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-11-23T21:19:36.000Z","updated_at":"2025-12-30T01:46:01.000Z","dependencies_parsed_at":"2023-11-27T13:44:56.658Z","dependency_job_id":"805ada7a-f93f-4c82-809a-e7d34c6fb00b","html_url":"https://github.com/omnipin/filebase-upload","commit_stats":null,"previous_names":["staurodev/filebase-upload","omnipin/filebase-upload"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/omnipin/filebase-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnipin%2Ffilebase-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnipin%2Ffilebase-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnipin%2Ffilebase-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnipin%2Ffilebase-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omnipin","download_url":"https://codeload.github.com/omnipin/filebase-upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnipin%2Ffilebase-upload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: 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":["filebase","ipfs","s3"],"created_at":"2026-01-13T21:47:25.966Z","updated_at":"2026-01-13T21:47:26.932Z","avatar_url":"https://github.com/omnipin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# filebase-upload\n\n[![Version][v-badge-url]][npm-url] [![GitHub Workflow Status][gh-actions-img]][github-actions]\n[![Codecov][cov-badge]][cov] [![][docs-badge]][docs]\n\nMinimal library to upload files on [Filebase](https://filebase.com) S3 API. Partially based on\n[AWS SDK v3](https://github.com/aws/aws-sdk-js-v3).\n\n## Install\n\nFor Node.js:\n\n```sh\npnpm i @omnipin/filebase-upload\n```\n\nFor Deno:\n\n```sh\ndeno add jsr:@omnipin/filebase-upload\n```\n\n## Usage\n\nFirst, you need to set up a token. A token is a base64 encoded pair of the access key and access secret.\n\nYou can generate a token like this:\n\n```sh\necho \"accessKey:accessSecret\" | base64\n```\n\nand save it to a `.env` file or somewhere else.\n\nThe default `apiUrl` is `s3.filebase.com`. To change, pass in the url to the `apiUrl` arg.\n\n### Node.js\n\n```ts\nimport { createPresignedUrl } from '@omnipin/filebase-upload'\n\nconst file = new File(['Hello world'], 'hello.txt')\n\nconst url = await createPresignedUrl({\n  bucketName: `example-${crypto.randomUUID()}`,\n  token: process.env.FILEBASE_TOKEN,\n  file,\n})\n\nawait fetch(decodeURIComponent(url), { method: 'PUT', body: file })\n```\n\nAnd then run as:\n\n```sh\nnode --env-file=.env main.js\n```\n\n### Deno\n\n```ts\nimport { createPresignedUrl } from '@omnipin/filebase-upload'\nimport { load } from '@std/dotenv'\n\nconst env = await load()\n\nconst file = new File(['Hello world'], 'hello.txt')\n\nconst url = await createPresignedUrl({\n  bucketName: `example-${crypto.randomUUID()}`,\n  token: env.FILEBASE_TOKEN,\n  file,\n})\n\nawait fetch(decodeURIComponent(url), { method: 'PUT', body: file })\n```\n\nAnd then run as:\n\n```sh\ndeno --allow-read --allow-net mod.ts\n```\n\n## API\n\n### uploadCar\n\nUpload a CAR file using `createPresignedUrl`. Returns a response object.\n\n```ts\nimport { uploadCar } from './mod.ts'\nimport { load } from 'https://deno.land/std@0.207.0/dotenv/mod.ts'\nimport { CAREncoderStream, createFileEncoderStream } from 'https://esm.sh/ipfs-car@1.0.0'\nimport { CID } from 'https://esm.sh/multiformats@12.1.3/cid'\n\nconst env = await load()\n\nconst init = {\n  bucketName: `filebase-upload-tests`,\n  token: env.FILEBASE_TOKEN,\n}\n\nconst placeholderCID = CID.parse('bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi')\n\nconst stream = createFileEncoderStream(new Blob(['Hello ipfs-car!']))\n  .pipeThrough(\n    new TransformStream(),\n  )\n  .pipeThrough(new CAREncoderStream([placeholderCID]))\n\nconst blob = await new Response(stream).blob()\n\nconst file = new File([blob], 'file.car')\n\nconst res = await uploadCar({ ...init, file })\n\nconsole.log(res.headers.get('x-amz-meta-cid'))\n```\n\n### createPresignedUrl\n\nCreates a presigned URL for file upload. All options except apiUrl and `metadata` are required.\n\nPassing a `metadata` object converts to a header object with `x-amz-meta-\u003ckey\u003e`.\n\n### getObject\n\nRetrieves an object from Filebase S3 API and returns a response object.\n\nYou can also retrieve the file CID from headers.\n\n```ts\nimport { getObject } from 'https://deno.land/x/filebase_upload/mod.ts'\n\nconst res = await getObject({\n  bucketName: `example-${crypto.randomUUID()}`,\n  token: env.FILEBASE_TOKEN,\n  filename: 'hello.txt',\n})\n\nconsole.log(`${res.headers.get('x-amz-meta-cid')}:`, await res.text())\n```\n\n### headObject\n\nChecks if the file has been uploaded. Returns a boolean and a CID of the file (if uploaded).\n\n```ts\nimport { headObject } from 'https://deno.land/x/filebase_upload/mod.ts'\n\nconst [isUploaded, cid] = await headObject({\n  bucketName: `example-${crypto.randomUUID()}`,\n  token: env.FILEBASE_TOKEN,\n  filename: 'hello.txt',\n})\n\nconsole.log(`is uploaded? ${isUploaded ? 'yes' : 'no'}`)\n```\n\n[docs-badge]: https://img.shields.io/github/v/release/staurodev/filebase-upload?label=Docs\u0026logo=deno\u0026style=for-the-badge\u0026color=FFAE00\n[docs]: https://doc.deno.land/https/deno.land/x/filebase_upload/mod.ts\n[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/staurodev/filebase-upload/ci.yml?branch=master\u0026style=for-the-badge\u0026logo=github\u0026label=\u0026color=FFAE00\u0026\n[github-actions]: https://github.com/staurodev/filebase-upload/actions\n[cov]: https://coveralls.io/github/StauroDEV/filebase-upload\n[cov-badge]: https://img.shields.io/coveralls/github/StauroDEV/filebase-upload?style=for-the-badge\u0026color=FFAE00\n[v-badge-url]: https://img.shields.io/npm/v/@omnipin/filebase-upload?style=for-the-badge\u0026logo=npm\u0026label=\u0026color=FFAE00\n[npm-url]: https://www.npmjs.com/package/@omnipin/filebase-upload\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomnipin%2Ffilebase-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomnipin%2Ffilebase-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomnipin%2Ffilebase-upload/lists"}