{"id":19063451,"url":"https://github.com/romainmuller/pko","last_synced_at":"2026-05-01T21:04:48.626Z","repository":{"id":38814605,"uuid":"179033336","full_name":"RomainMuller/pko","owner":"RomainMuller","description":"Run npm commands using a local registry overlay","archived":false,"fork":false,"pushed_at":"2023-01-09T16:02:22.000Z","size":1182,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-04T13:41:25.014Z","etag":null,"topics":["javascript","javascript-tools","local-development","npm","offline","overlay"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/RomainMuller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["RomainMuller"]}},"created_at":"2019-04-02T08:31:02.000Z","updated_at":"2021-06-03T15:14:20.000Z","dependencies_parsed_at":"2023-02-08T12:45:27.284Z","dependency_job_id":null,"html_url":"https://github.com/RomainMuller/pko","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomainMuller%2Fpko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomainMuller%2Fpko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomainMuller%2Fpko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomainMuller%2Fpko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RomainMuller","download_url":"https://codeload.github.com/RomainMuller/pko/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240118332,"owners_count":19750470,"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":["javascript","javascript-tools","local-development","npm","offline","overlay"],"created_at":"2024-11-09T00:36:01.260Z","updated_at":"2026-05-01T21:04:48.572Z","avatar_url":"https://github.com/RomainMuller.png","language":"TypeScript","funding_links":["https://github.com/sponsors/RomainMuller"],"categories":[],"sub_categories":[],"readme":"# `pko` - Package Overlay\n![Build Status](https://github.com/RomainMuller/pko/workflows/Validation%20Build/badge.svg)\n[![Maintainability](https://api.codeclimate.com/v1/badges/0dd9c68d88c6d6a7c672/maintainability)](https://codeclimate.com/github/RomainMuller/pko/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/0dd9c68d88c6d6a7c672/test_coverage)](https://codeclimate.com/github/RomainMuller/pko/test_coverage)\n[![npm package](https://img.shields.io/npm/v/pko/latest.svg)](https://www.npmjs.com/package/pko)\n\n`pko` is a drop-in replacement for `npm` that uses local files instead of the standard `npm` registry for the packages\nit has been set up with. If you're wondering why you would want to do such things, refer to the [use-cases](#Use-cases)\nsection of this document.\n\n*npm is a registered trademark of npm, Inc.*\n\n# Usage\n## Adding a package to the `pko` overlay\nSimply publish your packages using the `pko` command instead of the `npm` command (this cannot work for packages that\nhave `publishConfig` or `private: true` in their `package.json` file). No authentication is required.\n* For a package you're developing:\n  ```shell\n  pko publish path/to/package\n  ```\n* For a package from your `npm` registry of choice:\n  ```shell\n  TGZ=$(npm pack package[@version]) # Download the package locally\n  pko publish ${TGZ}              # Publish the downloaded package\n  rm ${TGZ}                         # Clean-up after yourself\n  ```\n\n## Determine which packages you have in the `pko` overlay\nThe `ls-overrides` subcommand will list all packages present in the local overlay and output their name and (latest)\nversion number to `STDOUT`.\n```shell\npko ls-overrides\n```\n\n## Install packages using the `pko` overlay\nSimply replace invokations of `npm` with `pko`, using the exact same arguments:\n```shell\npko install\npko install --save-dev @types/node\npko run build\n```\n\n## Overlay location\nThe overlay location is determined using the following procedure:\n1. The environment variable `$PKO_REPOSITORY`\n2. Walk up the tree from `$PWD` (the process' working directory) until:\n    1. A `.pko` directory is found\n    2. The root of the filesystem is reached\n3. Walk up the tree from where `pko` is installed in until:\n    1. A `.pko` directory is found\n    2. The root of the filesystem is reached\n4. Bail out in error.\n\n## Debugging\nVerbose logging can be enabled by setting the `PKO_VERBOSE` environment variable to a truthy value:\n```shell\nPKO_VERBOSE=1 pko install\n```\n\n# Use-cases\n* Distributing private packages without having to set-up a full-fledged `npm` registry for private use.\n  \u003e Simply prepare an overlay locally, then distribute that overlay (for example, in a ZIP file) to interested users.\n* Enable full offline usage of `npm`\n  \u003e Prepare an overlay with all the package versions that need to be available offline. No internet connectivity will\n  \u003e be required for using those.\n* Replacing a dependency with customized code (for quick experimentations, ...)\n  \u003e Publish your custom version under the exact same name as the package you want to replace to your overlay, and\n  \u003e `pko` will use that instead of the version found in the public `npm` registry.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://eladb.github.com/\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/598796?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eElad Ben-Israel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/RomainMuller/pko/commits?author=eladb\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/issues?q=author%3Aeladb\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/pulls?q=is%3Apr+reviewed-by%3Aeladb\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/commits?author=eladb\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#maintenance-eladb\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#ideas-eladb\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://rix0r.nl/\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/524162?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRico Huijbers\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/RomainMuller/pko/commits?author=rix0rrr\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/issues?q=author%3Arix0rrr\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/pulls?q=is%3Apr+reviewed-by%3Arix0rrr\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/commits?author=rix0rrr\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#maintenance-rix0rrr\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#ideas-rix0rrr\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://keybase.io/romainmuller\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/411689?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRomain Marcadier\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/RomainMuller/pko/commits?author=RomainMuller\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/issues?q=author%3ARomainMuller\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/pulls?q=is%3Apr+reviewed-by%3ARomainMuller\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/RomainMuller/pko/commits?author=RomainMuller\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#maintenance-RomainMuller\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#ideas-RomainMuller\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/apps/dependabot-preview\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/in/2141?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edependabot-preview[bot]\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-dependabot-preview[bot]\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/apps/dependabot\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/in/29110?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edependabot[bot]\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-dependabot[bot]\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/apps/greenkeeper\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/in/505?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003egreenkeeper[bot]\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-greenkeeper[bot]\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\nThis project is distributed under the [Apache-2.0] license.\n\n[Apache-2.0]: https://spdx.org/licenses/Apache-2.0.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromainmuller%2Fpko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromainmuller%2Fpko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromainmuller%2Fpko/lists"}