build-version

WebJar for build-version

License

License

Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-sholladay-build-version
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

build-version
WebJar for build-version
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sholladay/build-version

Download github-com-sholladay-build-version

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-sholladay-build-version/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-sholladay-build-version</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sholladay-build-version/
implementation 'org.webjars.npm:github-com-sholladay-build-version:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sholladay-build-version/
implementation ("org.webjars.npm:github-com-sholladay-build-version:1.0.0")
'org.webjars.npm:github-com-sholladay-build-version:jar:1.0.0'
<dependency org="org.webjars.npm" name="github-com-sholladay-build-version" rev="1.0.0">
  <artifact name="github-com-sholladay-build-version" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-sholladay-build-version', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-sholladay-build-version" % "1.0.0"
[org.webjars.npm/github-com-sholladay-build-version "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : head-hash jar [0.2.3,0.3)
org.webjars.npm : read-pkg-up jar [2.0.0,3)
org.webjars.npm : username jar [2.2.2,3)

Project Modules

There are no modules declared in this project.

build-version Build status for build-version

Get a version for your build

Why?

  • Versioning your builds improves integrity.
  • Ensures your build numbers are useful and meaningful.
  • Intelligent behavior in or out of a repository.

Install

npm install build-version --save

Usage

Get it into your program.

const buildVersion = require('build-version');

Get a version to use when writing the build.

buildVersion().then((version) => {
    console.log(version);
    // '1.0.0'
});

API

buildVersion(option)

Returns a Promise for the first successful of the following:

  1. A release tag, if the most recent commit is a release.
  2. The short hash of the most recent commit.
  3. The version from package.json, if not in a git repository.

If in a git repository and the working directory is dirty, the username and date are appended to the version. This makes dirty versions stand out and provides useful context for what might be different about the build.

For example: 1.0.0+sholladay.20161022T095547Z or a420250+sholladay.20161022T095547Z

option

Type: object

cwd

Type: string
Default: process.cwd()

Parent directory of the build root.

Related

Contributing

See our contributing guidelines for more details.

  1. Fork it.
  2. Make a feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

MPL-2.0 © Seth Holladay

Go make something, dang it.

Versions

Version
1.0.0