Skip to content

andyfry01/autocalver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autocalver

A Node utility for automatically generating properly formatted calver version numbers.

Will return a string with a calver version number for today's date, with no leading zeros on the month or day fields (on applicable dates).

Installation

# Install the autocalver package globally if you'd like to use it as a shell command.
npm install -g autocalver

# Install it locally if you'd like to use it as a Node package.
# ...or as locally-available executable. Whatever, it's 2009! 
npm install --save autocalver

Running as a Node package

If you would like to run autocalver as a Node package (i.e. within a JS file):

const autocalver = require('autocalver')
const calverNumber = autocalver()

console.log(calverNumber)
// => calver number!

Get a calver number for a date other than today

Use Javascript's Date constructor to create a Date object with your desired date, and pass this to autocalver:

const autocalver = require('autocalver')
const dateObj = new Date('1955-11-5')
const calverNumber = autocalver(dateObj)

console.log(calverNumber)
// => 1955.11.5

This feature is not available for the shell script ... yet. Maybe you could implement it in a PR? 🙃

Running as a shell script

autocalver can also be run as a shell script. You can call the shell command anywhere in your filesystem if you have installed the package globally, although the command will only be available locally to your specific node project if you have installed it locally.

# invoke the script thusly:
autocalver
# => calver number!

About

Automatically generates calver version numbers. Can be used as an npm package or shell command.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published