Socket
Socket
Sign inDemoInstall

@jessitron/git-branch-to-npm-tag

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jessitron/git-branch-to-npm-tag

Convert a git branch name to a valid npm tag


Version published
Weekly downloads
4
Maintainers
1
Install size
2.44 kB
Created
Weekly downloads
 

Readme

Source

git-branch-to-npm-tag

translate a valid git branch into a valid npm tag

Why

We have libraries, and we make branches on them, and then we want to use them to test downstream programs. Publishing to npm makes these branch-versions accessible to downstream installation.

By default, npm publish will also update the latest tag, which changes the default version people get when they install your library. I don't want them to get a branch-version! I want them to get the most recent versioned release.

So, for these branch versions, we'll do npm publish --tag ${branchName} ... except that not all valid git branch names are valid NPM tags. In particular, forward-slash is common in git branch names (I name my branches jessitron/whatever so people know they're mine). npm tags do not want a forward slash.

This also prefixes the branch name with "branch:" so that they'll group together.

I recommend deleting the branch tags when you delete the branch. npm dist-tag rm <package> <tag>

FAQs

Last updated on 15 Jun 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc