{"id":15361528,"url":"https://github.com/jonathanong/s3-set-headers","last_synced_at":"2025-04-15T08:41:09.039Z","repository":{"id":31938123,"uuid":"35507732","full_name":"jonathanong/s3-set-headers","owner":"jonathanong","description":"Update headers on all objects in a bucket","archived":false,"fork":false,"pushed_at":"2016-01-27T18:24:44.000Z","size":8,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T13:22:31.212Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanong.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}},"created_at":"2015-05-12T19:14:58.000Z","updated_at":"2019-09-30T03:45:22.000Z","dependencies_parsed_at":"2022-08-25T05:40:21.821Z","dependency_job_id":null,"html_url":"https://github.com/jonathanong/s3-set-headers","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fs3-set-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fs3-set-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fs3-set-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fs3-set-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanong","download_url":"https://codeload.github.com/jonathanong/s3-set-headers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249038887,"owners_count":21202803,"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-10-01T12:55:32.192Z","updated_at":"2025-04-15T08:41:09.017Z","avatar_url":"https://github.com/jonathanong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# s3-set-headers\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nIterate through a bucket, checking whether headers need updating,\nand updating them when necessary.\n\n## API\n\n```js\nconst Update = require('s3-set-headers')\n\nUpdate({\n  // s3 bucket information passed to `knox`\n  secret: '',\n  key: '',\n  bucket: '',\n\n  // s3 listing options passed to s3lister\n  prefix: '',\n\n  // maximum number of objects to update concurrently\n  concurrency: 5,\n\n  // whether the headers need updating\n  test(key, headers) {\n    return !headers['cache-control']\n  },\n\n  // new headers to set\n  update(key, headers) {\n    return {\n      'cache-control': 'public, max-age=3600',\n      'x-amz-acl': 'public-read',\n    }\n  }\n})\n```\n\n[npm-image]: https://img.shields.io/npm/v/s3-set-headers.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/s3-set-headers\n[github-tag]: http://img.shields.io/github/tag/jonathanong/s3-set-headers.svg?style=flat-square\n[github-url]: https://github.com/jonathanong/s3-set-headers/tags\n[travis-image]: https://img.shields.io/travis/jonathanong/s3-set-headers.svg?style=flat-square\n[travis-url]: https://travis-ci.org/jonathanong/s3-set-headers\n[coveralls-image]: https://img.shields.io/coveralls/jonathanong/s3-set-headers.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/jonathanong/s3-set-headers\n[david-image]: http://img.shields.io/david/jonathanong/s3-set-headers.svg?style=flat-square\n[david-url]: https://david-dm.org/jonathanong/s3-set-headers\n[license-image]: http://img.shields.io/npm/l/s3-set-headers.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/s3-set-headers.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/s3-set-headers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanong%2Fs3-set-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanong%2Fs3-set-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanong%2Fs3-set-headers/lists"}