{"id":19437790,"url":"https://github.com/architect/hydrate","last_synced_at":"2025-08-11T07:16:57.024Z","repository":{"id":43704046,"uuid":"189258872","full_name":"architect/hydrate","owner":"architect","description":"Architect dependency hydrator and shared file manager","archived":false,"fork":false,"pushed_at":"2025-04-06T14:22:27.000Z","size":784,"stargazers_count":4,"open_issues_count":5,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-01T14:11:52.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/architect.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","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}},"created_at":"2019-05-29T16:10:28.000Z","updated_at":"2024-09-28T22:58:03.000Z","dependencies_parsed_at":"2023-02-17T21:31:08.188Z","dependency_job_id":"52a9be60-e24a-4718-88c9-78f7c5d5956b","html_url":"https://github.com/architect/hydrate","commit_stats":{"total_commits":464,"total_committers":10,"mean_commits":46.4,"dds":"0.22413793103448276","last_synced_commit":"18a865adc50ce0ae33339384c190ae3df3106dc6"},"previous_names":[],"tags_count":161,"template":false,"template_full_name":null,"purl":"pkg:github/architect/hydrate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fhydrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fhydrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fhydrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fhydrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/architect","download_url":"https://codeload.github.com/architect/hydrate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fhydrate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269844408,"owners_count":24484193,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-10T15:15:54.746Z","updated_at":"2025-08-11T07:16:56.941Z","avatar_url":"https://github.com/architect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@architect/hydrate` [![GitHub CI status](https://github.com/architect/hydrate/workflows/Node%20CI/badge.svg)](https://github.com/architect/hydrate/actions?query=workflow%3A%22Node+CI%22)\n\n[@architect/hydrate][npm] ensures that all functions managed by Architect have their dependencies installed. Functions containing all required dependencies are considered to be 'hydrated' - thus the name!\n\n[@architect/hydrate][npm] supports dependencies managed in the following languages using the following package managers:\n\n- **Node.js** via `npm` using `package.json` (and optionally `package-lock.json`), or via `yarn` using `package.json` and `yarn.lock`\n- **Python** via `pip3` using a `requirements.txt` file\n- **Ruby** via `bundle` using `Gemfile` and `Gemfile.lock` files\n\n\n# Installation\n\n    npm install @architect/hydrate\n\n\n# API\n\nAll methods accept an `options` object can include the following properties:\n\n- `autoinstall` - **Boolean** - Enables or disables automated Lambda dependency treeshaking via static code analysis\n  - Defaults to `false`\n  - Used by `install`\n- `basepath` - **String** - Filesystem path in which Hydrate should search for functions\n  - Defaults the current working directory\n  - Useful if you want to hydrate one function or a subset of functions\n  - Used by `install` + `update`\n- `copyShared` - **Boolean** - Enables or disables copying of shared code folders (e.g. `src/shared`) into Lambdas\n  - Useful to disable if you want to just hydrate external dependencies\n  - Defaults to `true`\n  - Used by `install` + `update`\n- `cwd` - **String** - Root filesystem path of the project Hydrate is working in\n  - Defaults to current working directory\n  - May be the same or different from `basepath`; if using in conjunction with `basepath`, specify a subset of the project with `basepath`, for example:\n    - `{ cwd: '/your/project/', basepath: '/your/project/src/http/' }` runs Hydrate against `/your/project/` (without having to use `process.chdir`) and only hydrates functions within `/your/project/src/http/**`\n  - Used by `install` + `update` + `shared`\n- `hydrateShared` - **Boolean** - Enables or disables dependency hydration in shared code folders (e.g. `src/shared`)\n  - Useful to disable if you want to just hydrate external dependencies\n  - Defaults to `true`\n  - Used by `install` + `update`\n- `inventory` - **Object** - Architect Inventory object; generally used internally\n- `local` - **Boolean** - Favor the local platform during installation of dependencies that may be distributed as platform-specific binaries\n- `only` - **String** - Specify a subset of possible shared files for `shared` to copy into Lambdas\n  - Falsy by default\n  - Accepts: `shared`, `views`, or `staticJson`\n  - Used by `shared`\n- `quiet` - **Boolean** - Disables (most) logging\n- `symlink` - **Boolean** - Enables or disables symlinking instead of full directory copying, useful for local development\n  - Defaults to `false`\n  - Used by `install` + `update` + `shared`\n- `timeout` - **Number** - Amount of time in milliseconds to give each package manager process to execute\n  - Used by `install` + `update`\n- `verbose` - **Boolean** - Enables verbose logging\n\n\u003e **Note on `cwd` vs `basepath`**: `cwd` is necessary for Hydrate to find your project's manifest and key files and folders, while `basepath` scopes hydration to a specific path. When in doubt, include neither parameter, Hydrate will default to process working directory; if you know you need to aim Hydrate at a specific place but aren't sure which parameter to use, use `cwd`.\n\n\n## `hydrate.install(options[, callback]) → [Promise]`\n\nInstalls function dependencies, then invokes [`hydrate.shared()`][shared].\n\nTo ensure local development behavior is as close to `staging` and `production` as possible, `hydrate.install()` (and other hydrate functions) uses:\n\n- **Node.js**: `npm ci` if `package-lock.json` is present and `npm i` if not; or `yarn`\n- **Python**: `pip3 install`\n- **Ruby**: `bundle install`\n\nNote: by default `update` also installs dependencies in shared folders like `src/shared` and `src/views`.\n\n\n## `hydrate.update(options[, callback]) → [Promise]`\n\nUpdates function dependencies, then invokes [`hydrate.shared()`][shared].\n\n`update` is functionally almost identical to [`install`][install], except it will update dependencies to newer versions _if they exist_. This is done via:\n\n- **Node.js**: `npm update` or `yarn upgrade`\n- **Python**: `pip3 install -U --upgrade-strategy eager`\n- **Ruby**: `bundle update`\n\nNote: by default `update` also updates dependencies in shared folders like `src/shared` and `src/views`.\n\n\n## `hydrate.shared(options[, callback]) → [Promise]`\n\nCopies shared code (from `src/shared` and `src/views`, or your custom `@shared` + `@views` paths, if any) into all functions.\n\n\n[shared]: #hydratesharedoptions-callback\n[install]: #hydrateinstalloptions-callback\n[update]: #hydrateupdateoptions-callback\n[npm]: https://www.npmjs.com/package/@architect/hydrate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fhydrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchitect%2Fhydrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fhydrate/lists"}