{"id":19584806,"url":"https://github.com/flex-development/dist-tag","last_synced_at":"2026-05-12T20:03:19.953Z","repository":{"id":42004998,"uuid":"399966966","full_name":"flex-development/dist-tag","owner":"flex-development","description":"Distribution tag lookup utility","archived":false,"fork":false,"pushed_at":"2023-01-27T06:07:46.000Z","size":2591,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-17T02:44:27.328Z","etag":null,"topics":["dist-tag","npm-dist-tag","npm-publish","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flex-development.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-25T21:58:35.000Z","updated_at":"2022-08-15T02:13:55.000Z","dependencies_parsed_at":"2023-02-15T06:16:07.363Z","dependency_job_id":null,"html_url":"https://github.com/flex-development/dist-tag","commit_stats":null,"previous_names":["flex-development/dtag"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flex-development%2Fdist-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flex-development%2Fdist-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flex-development%2Fdist-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flex-development%2Fdist-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flex-development","download_url":"https://codeload.github.com/flex-development/dist-tag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240771878,"owners_count":19854981,"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":["dist-tag","npm-dist-tag","npm-publish","typescript"],"created_at":"2024-11-11T07:49:50.406Z","updated_at":"2026-05-12T20:03:14.906Z","avatar_url":"https://github.com/flex-development.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dist-tag\n\n[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![module type: esm](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)\n[![npm](https://img.shields.io/npm/v/@flex-development/dist-tag.svg)](https://npmjs.com/package/@flex-development/dist-tag)\n[![license](https://img.shields.io/github/license/flex-development/dist-tag.svg)](LICENSE.md)\n[![typescript](https://badgen.net/badge/-/typescript?color=2a72bc\u0026icon=typescript\u0026label)](https://typescriptlang.org)\n\n\u003e [Distribution tag][1] lookup utility for Node.js and CLI environments.\n\n## Install\n\n```sh\nyarn add @flex-development/dist-tag\n```\n\n### GitHub Package Registry\n\nTo install from the GitHub Package Registry, setup a `.npmrc` or `.yarnrc.yml`\nfile to authenticate with the registry. A [Personal Access Token with at least\nthe `read:packages` scope][2] is required.\n\n#### `.npmrc`\n\n```utf-8\n//npm.pkg.github.com/:_authToken=${GH_PAT}\n@flex-development:registry=https://npm.pkg.github.com/\n```\n\n#### `.yarnrc.yml`\n\n```yaml\nnpmRegistries:\n  //npm.pkg.github.com:\n    npmAlwaysAuth: true\n    npmAuthToken: ${GH_PAT}\n\nnpmScopes:\n  flex-development:\n    npmRegistryServer: https://npm.pkg.github.com\n```\n\n### Git\n\nFor details on requesting a specific branch, commit, or tag, see\n[npm-install][3] or [Git - Protocols | Yarn][4].\n\n#### NPM\n\n```sh\nnpm i flex-development/dist-tag\n```\n\n#### Yarn\n\n```sh\nyarn add @flex-development/dist-tag@flex-development/dist-tag\n```\n\n## Usage\n\n### CLI\n\n```sh\nUsage\n  $ dist-tag [target] [options]\n\nOptions\n  -d, --delimiter Lookup target separator\n  -v, --version Displays current version\n  -h, --help Displays this message\n\nExamples\n  $ dist-tag                                             # ''\n  $ dist-tag 2.0.0                                       # ''\n  $ dist-tag 2.0.0-alpha.1                               # 'alpha'\n  $ dist-tag foo-package@2.0.0-beta.1 --delimiter @      # 'beta'\n  $ dist-tag $(git describe --tags --abbrev=0) -d @      # depends on the tag 😉\n```\n\nIf you installed `dist-tag` locally, you may need to update your `PATH`:\n\n```sh\n[ -d $PWD/node_modules/.bin ] \u0026\u0026 export PATH=$PWD/node_modules/.bin:$PATH\n```\n\n### Node.js\n\n```typescript\nimport dtag from '@flex-development/dist-tag'\n\nconsole.log(dtag()) // ''\nconsole.log(dtag({ target: '2.0.0' })) // ''\nconsole.log(dtag({ target: '2.0.0-alpha.1' })) // 'alpha'\nconsole.log(dtag({ delimiter: '@', target: 'foo-package@2.0.0-beta.1' })) // 'beta'\n```\n\nOptions can be viewed [here](src/options.ts).\n\n[1]: https://docs.npmjs.com/cli/v8/commands/npm-dist-tag\n[2]:\n  https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries\n[3]: https://docs.npmjs.com/cli/v8/commands/npm-install#description\n[4]: https://yarnpkg.com/features/protocols#git\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflex-development%2Fdist-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflex-development%2Fdist-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflex-development%2Fdist-tag/lists"}