{"id":22484974,"url":"https://github.com/cyclic-software/s3fs","last_synced_at":"2025-08-02T18:31:04.780Z","repository":{"id":65346432,"uuid":"576451111","full_name":"cyclic-software/s3fs","owner":"cyclic-software","description":"Drop in replacement for the Node.js fs library backed by AWS S3","archived":false,"fork":false,"pushed_at":"2023-10-18T20:18:21.000Z","size":1033,"stargazers_count":123,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-11T21:20:42.775Z","etag":null,"topics":["aws","cyclic-sh","fs","nodejs","s3"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cyclic.sh/s3fs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyclic-software.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}},"created_at":"2022-12-09T22:37:50.000Z","updated_at":"2024-08-06T06:08:18.000Z","dependencies_parsed_at":"2024-06-21T03:07:17.865Z","dependency_job_id":null,"html_url":"https://github.com/cyclic-software/s3fs","commit_stats":{"total_commits":90,"total_committers":4,"mean_commits":22.5,"dds":"0.23333333333333328","last_synced_commit":"3cd949b6af0e1720b97cdaf9aaeeb4aa51de3605"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclic-software%2Fs3fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclic-software%2Fs3fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclic-software%2Fs3fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyclic-software%2Fs3fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyclic-software","download_url":"https://codeload.github.com/cyclic-software/s3fs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228499923,"owners_count":17929985,"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":["aws","cyclic-sh","fs","nodejs","s3"],"created_at":"2024-12-06T17:11:49.848Z","updated_at":"2024-12-06T17:13:33.710Z","avatar_url":"https://github.com/cyclic-software.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# @cyclic.sh/s3fs\n\nDrop in replacement for the Node.js `fs` library backed by AWS S3. \nUse the same methods as `fs` and enjoy the convenience of S3 buckets without the hassle of AWS. \n\n[![Discord](https://img.shields.io/discord/895292239633338380)](https://discord.cyclic.sh/support) [![CI](https://github.com/cyclic-software/s3fs/actions/workflows/run_tests.yaml/badge.svg)](https://github.com/cyclic-software/s3fs/actions/workflows/run_tests.yaml) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\n[![npm (scoped)](https://img.shields.io/npm/v/@cyclic.sh/s3fs)](https://www.npmjs.com/package/@cyclic.sh/s3fs) ![node-current (scoped)](https://img.shields.io/node/v/@cyclic.sh/s3fs) ![code size](https://img.shields.io/github/languages/code-size/cyclic-software/s3fs) [![@cyclic.sh/s3fs](https://snyk.io/advisor/npm-package/@cyclic.sh/s3fs/badge.svg)](https://snyk.io/advisor/npm-package/@cyclic.sh/s3fs)\n\n\n## Supported methods\n`@cyclic.sh/s3fs` supports the following `fs` methods operating on AWS S3:\n- writeFile / writeFileSync\n- readFile / readFileSync\n- exists / existsSync\n- rm / rmSync\n- stat / statSync\n- unlink / unlinkSync\n- readdir / readdirSync\n- mkdir / mkdirSync\n- rmdir / rmdirSync\n\n## Example Usage\n### Installation\n\n```\nnpm install @cyclic.sh/s3fs\n```\n\nRequire in the same format as Node.js `fs`, specifying an S3 Bucket: \n- Callbacks and Sync methods:\n  ```js\n  const fs = require('@cyclic.sh/s3fs')(S3_BUCKET_NAME)\n  ```\n- Promises (for async/await functions):\n  ```js\n  const fs = require('@cyclic.sh/s3fs/promises')(S3_BUCKET_NAME)\n  ```\n\n- On Cyclic.sh\n  -  Alternatively, when using with  \u003ca href=\"https://cyclic.sh\" target=\"_blank\"\u003ecyclic.sh\u003c/a\u003e or if the environment variable `CYCLIC_BUCKET_NAME` is set to an S3 bucket name, initialization can happen without specifying a bucket:\n      ```js\n      const fs = require('@cyclic.sh/s3fs') \n      ```\n      or\n      ```js\n      const fs = require('@cyclic.sh/s3fs/promises') \n      ```\n\n### Authentication\n\nAuthenticating the client:\n- **cyclic.sh** -  \n  - When deploying on \u003ca href=\"https://cyclic.sh\" target=\"_blank\"\u003ecyclic.sh\u003c/a\u003e, credentials are already available in the environment.\n  - The bucket name is also available under the `CYCLIC_BUCKET_NAME` variable.\n  - Read more: \u003ca href=\"https://docs.cyclic.sh/concepts/env_vars#cyclic\" target=\"_blank\"\u003eCyclic Environment Variables\u003c/a\u003e\n  \n- **Local Mode** - When no credentials are available, the client will fall back to using `fs` and the local filesystem. A warning will show in the terminal.\n  \n- **Environment Variables** - The internal S3 client will use AWS credentials if they are set in the local environment. Variables provided by Cyclic.sh may be found in \"Data/Storage\" tab in the user's Cyclic dashboard and will reset after 60 minutes.\n  ```\n  AWS_REGION\n  AWS_ACCESS_KEY_ID\n  AWS_SECRET_KEY\n  AWS_SECRET_ACCESS_KEY\n  ```\n\n- **Client Credentials** - The library also accepts standard S3 client parameters at initialization. For example: \n  ```js\n  const fs = require('@cyclic.sh/s3fs')(S3_BUCKET_NAME, {\n          region: ...\n          credentials: {...}\n      })\n  ```   \n\n### Using Methods\n\nThe supported methods have the same API as Node.js `fs` and can be written as follows:\n- Sync\n  ```js\n    const fs = require('@cyclic.sh/s3fs')(S3_BUCKET_NAME)\n    const json = JSON.parse(fs.readFileSync('test/_read.json'))\n  ```\n- Callbacks\n  ```js\n    const fs = require('@cyclic.sh/s3fs')(S3_BUCKET_NAME)\n    fs.readFile('test/_read.json', (error,data)=\u003e{\n      const json = JSON.parse(data)\n    })\n  ```\n- Promises (async/await)\n  ```js\n    const fs = require('@cyclic.sh/s3fs/promises')(S3_BUCKET_NAME)\n    async function run(){\n      const json = JSON.parse(await fs.readFile('test/_read.json'))\n    }\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclic-software%2Fs3fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyclic-software%2Fs3fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclic-software%2Fs3fs/lists"}