{"id":21558115,"url":"https://github.com/koopjs/koop-filesystem-s3","last_synced_at":"2025-06-22T09:40:11.215Z","repository":{"id":57125439,"uuid":"55445508","full_name":"koopjs/koop-filesystem-s3","owner":"koopjs","description":"Koop S3 Filesystem Plugin","archived":false,"fork":false,"pushed_at":"2022-12-09T21:49:57.000Z","size":79,"stargazers_count":7,"open_issues_count":7,"forks_count":3,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-16T19:16:18.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/koopjs.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-04T21:11:18.000Z","updated_at":"2018-12-26T15:21:28.000Z","dependencies_parsed_at":"2023-01-25T17:15:42.659Z","dependency_job_id":null,"html_url":"https://github.com/koopjs/koop-filesystem-s3","commit_stats":null,"previous_names":["koopjs/koop-s3fs"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koopjs","download_url":"https://codeload.github.com/koopjs/koop-filesystem-s3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247898499,"owners_count":21014719,"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":[],"created_at":"2024-11-24T08:14:01.787Z","updated_at":"2025-04-10T10:41:48.322Z","avatar_url":"https://github.com/koopjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koop-FileSystem-S3\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/koop-filesystem-s3.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/koopjs/koop-filesystem-s3.svg?branch=master)](https://travis-ci.org/koopjs/koop-filesystem-s3)\n\n\nKoop integration with Amazon S3\n\n## Install\n\nkoop-s3fs should be installed as a dependency in a Node.js project like so:\n\n```\nnpm install koop-s3fs --save\n```\n\n## Config\n\nkoop-s3fs requires a json config file like so:\n\n```\n{\n  \"filesystem\": {\n    \"s3\": {\n      \"bucket\": $S3_BUCKET,\n      \"endpoint\" $S3-ENDPOINT //optional https://forums.aws.amazon.com/ann.jspa?annID=3112\n    }\n  }\n}\n```\n\nAdditionally you will need to supply your:\n\n```\nAWS_ACCESS_KEY_ID\nAWS_SECRET_ACCESS_KEY\n```\nor configure the AWS CLI with keys.\n\n\n## Methods\n\n```js\nconst Filesystem = require('koop-s3fs')\nconst s3fs = new Filesystem()\nconst fs = require('fs')\n\n/**\n * createWriteStream writes to AWS S3 as a Highland stream\n *\n * @param {string} name - filename\n * @param {object} options - optional metadata to attach to file\n * @returns {stream} stream\n */\n\nconst stream = fs.createReadStream('path/to/file')\n  .pipe(s3fs.createWriteStream('filename'))\n\n\n/**\n * createReadStream reads file from AWS s3 as highland stream\n *\n * @param {string} file - filename\n * @returns {stream}\n */\n\ns3fs.createReadStream('filename').toArray(arr =\u003e {\n  const txt = arr.toString()\n  console.log(txt)\n})\n\n\n/**\n * stat accesses file metadata\n *\n * @param {string} file - filename\n * @param {function} callback\n * @returns {promise} returns resolved promise\n */\n\ns3fs.stat('filename', (err, data) =\u003e {\n  console.log(data)\n  /*  Stats {\n      getEntry: [Function],\n      dev: 0,\n      mode: 0,\n      nlink: 0,\n      uid: 0,\n      gid: 0,\n      rdev: 0,\n      blksize: undefined,\n      ino: 0,\n      size: 37,\n      blocks: undefined,\n      atime: Wed Apr 13 2016 13:15:14 GMT-0400 (EDT),\n      mtime: Wed Apr 13 2016 13:15:14 GMT-0400 (EDT),\n      ctime: Wed Apr 13 2016 13:15:14 GMT-0400 (EDT),\n      birthtime: Invalid Date,\n      acceptRanges: 'bytes',\n      ETag: '\"b3b285a1749957f3e3a627a8e92b65bc\"',\n      ContentType: 'application/octet-stream',\n      Metadata: { test: 'this is a test' } }\n  */\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-filesystem-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoopjs%2Fkoop-filesystem-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-filesystem-s3/lists"}