{"id":22139869,"url":"https://github.com/yvele/poosh","last_synced_at":"2025-07-25T22:32:38.025Z","repository":{"id":57228925,"uuid":"55765154","full_name":"yvele/poosh","owner":"yvele","description":":earth_americas: Publish local files to virtually any remote endpoint (e.g. AWS S3)","archived":false,"fork":false,"pushed_at":"2022-08-22T12:32:56.000Z","size":256,"stargazers_count":54,"open_issues_count":5,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-20T04:36:24.881Z","etag":null,"topics":["aws-s3","publishing","synchronization","upload"],"latest_commit_sha":null,"homepage":"","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/yvele.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-08T08:57:46.000Z","updated_at":"2023-03-13T01:49:52.000Z","dependencies_parsed_at":"2022-09-14T14:51:06.848Z","dependency_job_id":null,"html_url":"https://github.com/yvele/poosh","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fpoosh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fpoosh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fpoosh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fpoosh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yvele","download_url":"https://codeload.github.com/yvele/poosh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227421669,"owners_count":17775012,"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-s3","publishing","synchronization","upload"],"created_at":"2024-12-01T20:19:43.447Z","updated_at":"2024-12-01T20:19:44.179Z","avatar_url":"https://github.com/yvele.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# poosh\n\n\u003e Publish local files to virtually any remote endpoint (AWS S3, etc.)\n\n[![npm version](https://img.shields.io/npm/v/poosh-cli.svg)](https://www.npmjs.com/package/poosh-cli)\n[![Travis Status](https://img.shields.io/travis/yvele/poosh/master.svg?label=travis)](https://travis-ci.org/yvele/poosh)\n[![Coverage Status](https://img.shields.io/codecov/c/github/yvele/poosh/master.svg)](https://codecov.io/github/yvele/poosh)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n![poosh cli screenshot](media/screenshot-publish.png)\n\n\n## Short Example\n\nInstall [poosh CLI][poosh-cli] and [S3 plugin][poosh-plugin-s3]:\n\n```shell\n\u003e npm install -g poosh-cli poosh-plugin-s3\n```\n\nCreate a `.poosh.json5` file at the root of your project:\n\n```json5\n{\n  plugins : [\"s3\"],\n  baseDir : \"./deploy\",\n  remote  : \"s3-us-west-2.amazonaws.com/my-bucket\",\n\n  each: [{\n    headers   : { \"cache-control\": { cacheable: \"public\" } }\n  }, {\n    match     : \"**/*.{html,css,js}\",\n    gzip      : true,\n    headers   : { \"cache-control\": { maxAge: \"48 hours\" } }\n  }, {\n    match     : \"**/*.{jpg,png,gif,ico}\",\n    gzip      : false,\n    headers   : { \"cache-control\": { maxAge: \"1 year\" } }\n  }, {\n    match     : \"**/*.html\",\n    priority  : -1\n  }]\n}\n```\n\nYou can now upload:\n\n```shell\n\u003e poosh\n```\n\nOr sync if you want to delete remote files that has been locally removed:\n\n```shell\n\u003e poosh sync\n```\n\n## Main Features\n\n[Glob Selection](#glob-selection) |\n[GZIP](#gzip) |\n[HTTP Headers](#http-headers) |\n[Upload Ordering](#upload-ordering) |\n[Automatic Redirection](#automatic-redirection) |\n[Cache](#cache) |\n[Simulation](#simulation)\n\nPoosh allow you to upload and sync local files to virtually any remote destination.\n\n### Glob Selection\n\nUsing the [match](#each) [option](#options),\nlocal files that needs to be uploaded can be selected and configured with a [glob] string:\n\n```json5\n{\n  each: [{\n    match: \"**/*.html\"\n  }]\n}\n```\n\nor an array of patterns\n\n```json5\n{\n  each: [{\n    match: [\"*.*\", \"!*.txt\"]\n  }]\n}\n```\n\nSome supported glob features are:\n\n| Feature | Example\n| ------- | --------\n| [Brace Expansion](https://github.com/jonschlinkert/braces) | `\"foo/bar-{1..5}.html\"`, `\"one/{two,three}/four.html\"`\n| Typical glob patterns | `\"**/*\"`, `\"a/b/*.js\"`\n| Logical OR | \u003ccode\u003e\"foo/bar/(abc\u0026#124;xyz).js\"\u003c/code\u003e |\n| Regex character classes | `\"foo/bar/baz-[1-5].jpg\"`\n| POSIX [bracket expressions](https://github.com/jonschlinkert/expand-brackets) | `\"**/[[:alpha:][:digit:]]/\"`\n| [extglobs](https://github.com/jonschlinkert/extglob) | \u003ccode\u003e\"**/+(x\u0026#124;y)\"\u003c/code\u003e, \u003ccode\u003e\"!(a\u0026#124;b)\"\u003c/code\u003e, etc.\n\n### GZIP\n\nUsing the [GZIP](#each) [option](#options), files can be compressed at remote destination:\n\n```json5\n{\n  each: [{\n    match : \"**/*.html\",\n    gzip  : true\n  }]\n}\n```\n\n`content-encoding` HTTP header will accordingly be set to `gzip`.\n\n### HTTP Headers\n\nUsing the [headers](#headers) [option](#options),\nHTTP headers can be configured for each files:\n\n```json5\n{\n  each: [{\n    match : \"**/*.html\",\n    headers: {\n      \"cache-control\": {\n        maxAge      : \"60 days\",\n        cacheable   : \"public\",\n        noTransform : true,\n        immutable   : true\n      },\n      \"content-disposition\" : \"attachment; filename=\\\"foo.html\\\"\",\n      \"content-encoding\"    : \"utf-8\",\n      \"content-language\"    : \"en-us\",\n      \"content-length\"      : 500,\n      \"content-md5\"         : \"Q2hlY2sgSW50ZWdyaXR5IQ==\",\n      \"content-type\"        : \"text/html; charset=utf-8\",\n      \"expires\"             : \"0\",\n      \"location\"            : \"http://www.zombo.com\"\n    }\n  }]\n}\n```\n\n`content-encoding`, `content-length` and `content-type` HTTP headers are automatically generated by default.\n\n### Upload Ordering\n\nSometimes some files must be uploaded before other ones to avoid inconsistency.\nThe [priority](#each) [option](#options) can be used to order uploads:\n\n```json5\n{\n  each: [{\n    match     : \"**/*.html\",\n    priority  : -1\n  }]\n}\n```\n\nGreatest values are uploaded first.\n\n### Automatic Redirection\n\nUsing the [header-location-from-html](packages/poosh-plugin-header-location-from-html) plugin,\nthe `location` HTTP header can be automatically generated from a file HTML [http-equiv](http://www.w3schools.com/tags/att_meta_http_equiv.asp) meta tag.\n\nFirst install the plugin:\n\n```shell\n\u003e npm install -g poosh-plugin-header-location-from-html\n```\n\nAnd then use it in your configuration file:\n\n```json5\n{\n  plugins: [\"header-location-from-html\"],\n  each: [{\n    match     : \"**/*.html\",\n    headers   : { location: { fromContent: true } }\n  }]\n}\n```\n\n### Cache\n\nWhen local files are processed, a `.poosh.cache` file is generated next to the `.poosh.json5` configuration file.\n\nConsecutive runs of poosh will use this file to avoid unnecessary remote requests.\n\n[Poosh CLI][poosh-cli] can be used with the `--force` options to bypass cache lookup:\n\n```shell\n\u003e poosh --force cache\n```\n\nThe cache file is written after each individual file processing\n(using the great [NeDB append-only format](https://github.com/louischatriot/nedb#persistence)).\nCache file stores 3 separate hash keys for each processed local file:\n  - File content hash key\n  - HTTP headers hash key\n  - Remote options hash key\n\nThis is useful to poosh to detect distinctive local changes in either file content, HTTP headers and remote options.\n\n### Simulation\n\nUsing the [CLI][poosh-cli] `--dry-run` or `--read-only` options,\nno changes will be maid while output still showing potential changes:\n\n```shell\n\u003e poosh --dry-run\n```\n\nor\n\n```shell\n\u003e poosh sync --dry-run\n```\n\n## Options\n\n| Option       | Default | Description\n| ------------ | ------- | -------------\n| plugins      | `[]`    | List of plugins to load and use. A single plugin is designed by it's package name (with or without it's `poosh-plugin-` prefix).\n| baseDir      | `null`  | The base directory of local files. This path can either be absolute or relative (to the configuration file).\n| remote       | `null`  | The remote client or a key/value map of remote clients to use for processing files. See your remote plugin documentation for more information (e.g. [S3 Plugin][poosh-plugin-s3]).\n| concurrency  | `3`     | File processing concurrency.\n| each         | `[]`    | List of items used to select and process local files. Available options are described in the [each section](#each).\n| ignore       | `[]`    | List of [glob] strings identifying files to totally ignore (prevent files to be created, updated or deleted).\n\n### Each\n\nAll \"each\" items are applied to files **in order**. Same options are overridden by the last one.\n\n| Option       | Default     | Description\n| ------------ | ----------- | -------------\n| match        | `null`      | A [glob] string used to match files. If not specified, other options are applied to all files without marking them \"to be processed\".\n| priority     | `null`      | Greatest values are processed first.\n| gzip         | `false`     | If true, will gzip the file in remote destination.\n| headers      | `[]`        | List of [headers options](#headers).\n| remote       | `\"default\"` | The [key of the remote client](#options) to use. Or an object with an `id` key and some other ones that will define specific remote client options.\n\n### Headers\n\nOptions used to control file's HTTP headers.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eOption\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecache-control\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\n      String or object. The object can be a combination of the following keys:\n      \u003cul\u003e\n        \u003cli\u003e\n          \u003cstrong\u003emaxAge\u003c/strong\u003e:\n          A number (of seconds) or a string that will be parsed by\n          \u003ca href=\"https://github.com/rauchg/ms.js\"\u003ems\u003c/a\u003e.\n          For example\n          \u003ccode\u003e\"60 days\"\u003c/code\u003e,\n          \u003ccode\u003e\"2.5 hours\"\u003c/code\u003e,\n          \u003ccode\u003e\"1 year\"\u003c/code\u003e,\n          \u003ccode\u003e\"35 minutes\"\u003c/code\u003e,\n          etc.\n        \u003c/li\u003e\n        \u003cli\u003e\n          \u003cstrong\u003ecacheable\u003c/strong\u003e:\n          Can be one of the following values:\n          \u003ccode\u003enull\u003c/code\u003e,\n          \u003ccode\u003e\"public\"\u003c/code\u003e,\n          \u003ccode\u003e\"private\"\u003c/code\u003e,\n          \u003ccode\u003e\"no-cache\"\u003c/code\u003e.\n          \u003c/li\u003e\n        \u003cli\u003e\n          \u003cstrong\u003enoTransform\u003c/strong\u003e:\n          Boolean.\n        \u003c/li\u003e\n      \u003c/ul\u003e\n      All those keys are \u003ccode\u003enull\u003c/code\u003e by default.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent-disposition\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eString.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent-encoding\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\n      Content encoding header is automatically generated at runtime.\n      Using this option will force the header to the specified value.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent-language\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eString.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent-length\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\n      Number.\n      Content length header is automatically generated at runtime.\n      Using this option will force the header to the specified value.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent-md5\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eString.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econtent-type\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\n      Content type header is automatically generated at runtime.\n      Using this option will force the header to the specified value.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eexpires\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eString.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003elocation\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003enull\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eString.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n[glob]: https://github.com/jonschlinkert/micromatch#features\n[poosh-cli]: packages/poosh-cli\n[poosh-plugin-s3]: packages/poosh-plugin-s3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvele%2Fpoosh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyvele%2Fpoosh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvele%2Fpoosh/lists"}