2.0.0 • Published 4 years ago

daily-version v2.0.0

Weekly downloads
924
License
MIT
Repository
github
Last release
4 years ago

daily-version

Get the current date formatted as a version. Automatically add the time if there’s already a git tag for today’s version.

daily-version can be used to version your daily/nightly builds while still allowing multiple versions each day.

Based on utc-version, uses git to determine whether to use the short version (e.g. 20.12.31 or the long version 20.12.31.2330 if a tag of the first version already exists)

It also exists as a GitHub Action: fregante/daily-version-action.

Install

npm install daily-version

API

dailyVersion(prefix?)

Returns a string

const dailyVersion = require('daily-version');

dailyVersion();
// -> 17.8.29

// If 17.8.29 already exists and you call it
dailyVersion();
// -> 17.8.29.1451
// Detects the existing tag, and includes generates a sub-version based on the hours/seconds

dailyVersion('v');
// -> v17.8.29.1451
// Lets you specify any prefix

prefix

Type: string Optional

CLI

\$ daily-version prefix

Outputs the version to stdout.

$ daily-version
17.8.29

$ git tag $(daily-version)
# Creates a tag named 17.8.29

$ daily-version
17.8.29.1451
# Detects the existing tag, and includes generates a sub-version based on the hours/seconds

$ daily-version v
v17.8.29.1451
# Lets you specify any prefix

prefix

Optional

GitHub Actions

There's also an equivalent GitHub Action that makes it super easy: daily-version-action

License

MIT © Federico Brigante

2.0.0

4 years ago

1.0.0

4 years ago

0.12.0

5 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago