Socket
Book a DemoInstallSign in
Socket

@flex-development/dist-tag

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flex-development/dist-tag

Distribution tag lookup utility

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

dist-tag

conventional commits code style: prettier module type: esm npm license typescript

Distribution tag lookup utility for Node.js and CLI environments.

Install

yarn add @flex-development/dist-tag

GitHub Package Registry

To install from the GitHub Package Registry, setup a .npmrc or .yarnrc.yml file to authenticate with the registry. A Personal Access Token with at least the read:packages scope is required.

.npmrc

//npm.pkg.github.com/:_authToken=${GH_PAT}
@flex-development:registry=https://npm.pkg.github.com/

.yarnrc.yml

npmRegistries:
  //npm.pkg.github.com:
    npmAlwaysAuth: true
    npmAuthToken: ${GH_PAT}

npmScopes:
  flex-development:
    npmRegistryServer: https://npm.pkg.github.com

Git

For details on requesting a specific branch, commit, or tag, see npm-install or Git - Protocols | Yarn.

NPM

npm i flex-development/dist-tag

Yarn

yarn add @flex-development/dist-tag@flex-development/dist-tag

Usage

CLI

Usage
  $ dist-tag [target] [options]

Options
  -d, --delimiter Lookup target separator
  -v, --version Displays current version
  -h, --help Displays this message

Examples
  $ dist-tag                                             # ''
  $ dist-tag 2.0.0                                       # ''
  $ dist-tag 2.0.0-alpha.1                               # 'alpha'
  $ dist-tag foo-package@2.0.0-beta.1 --delimiter @      # 'beta'
  $ dist-tag $(git describe --tags --abbrev=0) -d @      # depends on the tag 😉

If you installed dist-tag locally, you may need to update your PATH:

[ -d $PWD/node_modules/.bin ] && export PATH=$PWD/node_modules/.bin:$PATH

Node.js

import dtag from '@flex-development/dist-tag'

console.log(dtag()) // ''
console.log(dtag({ target: '2.0.0' })) // ''
console.log(dtag({ target: '2.0.0-alpha.1' })) // 'alpha'
console.log(dtag({ delimiter: '@', target: 'foo-package@2.0.0-beta.1' })) // 'beta'

Options can be viewed here.

Keywords

dist-tag

FAQs

Package last updated on 22 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts