Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nerdbank-gitversioning

Package Overview
Dependencies
Maintainers
0
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nerdbank-gitversioning

Stamps your NPM packages with semver 2.0 compliant git commit specific version information.

  • 3.7.112
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7K
decreased by-31.34%
Maintainers
0
Weekly downloads
 
Created
Source

nerdbank-gitversioning

With this package, and a version.json file to express your version number checked into the root of your git repo:

{
  "version": "1.0-beta"
}

Your NPM packages and other builds can be automatically stamped with a version that precisely describes the git commit that built it.

CLI use

Stamp your package.json file with the git-based version:

nbgv-setversion

Reset your package.json file with a version placeholder (suitable for checking in):

nbgv-setversion --reset

Or invoke the nbgv tool directly for many options:

nbgv -?

Pack script

A possible script to pack your NPM package:

yarn nbgv-setversion
yarn pack
yarn nbgv-setversion --reset

Programmatic consumption

import * as nbgv from 'nerdbank-gitversioning'

// Retrieve all sorts of version information. Print just one bit.
const versionInfo = await nbgv.getVersion();
console.log(versionInfo.npmPackageVersion);

// Stamp the package.json file in the current directory with the computed version.
await nbgv.setPackageVersion();

// After packing, reset your package.json file to using a placeholder version number.
await nbgv.resetPackageVersionPlaceholder();

See our project README for more information.

Keywords

FAQs

Package last updated on 12 Dec 2024

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc