opinionated package versioner
npm install @uscreen.de/versionize



> Opinionated package versioner
This package can be used for versioning your Node.js projects. It uses Semantic Versioning and increments versions by specifying the desired release type.
- node v18 or higher
Add the module within your monorepo:
``bash`
$ pnpm add -D @uscreen.de/versionize
`bash`
$ versionize latest // => increments (minor) pre-release version
$ versionize stable // => increments minor version
$ versionize hotfix // => increments patch version
$ versionize // => outputs current version
Versions are written into package.json and manifest.json. The package.json always contains the current stable release version. The manifest.json contains the current pre-release version, if given, otherwise also the current stable release version.
#### Raw output
If you want to use versionize's output for shell scripts or similar, use the option --raw. Instead of the default output, versionize will only write the new version to stdout, without any pretty printing.
#### Commit & tag via Git
If used with option --commit, versionize will automatically commit the changes it made to package.json and manifest.json. If used with option --tag, versionize will additionally tag the automatic commit with the new version.
You need a working git binary in your PATH.
The package also exposes some methods so you could use versionize inside your project:
`javascript`
import { getCurrentVersion, bumpVersion } from '@uscreen.de/versionize'
#### getCurrentVersion
Get the current version of your project:
`javascript`
const myVersion = getCurrentVersion()
You could overwrite the current working directory with the option cwd:
`javascript`
const myVersion = getCurrentVersion({ cwd: '/path/to/my/project' })
#### bumpVersion
Bump the version of your project:
`javascript`
bumpVersion('stable')
You could overwrite the current working directory with the option cwd:
`javascript`
bumpVersion('stable', { cwd: '/path/to/my/project' })
To commit or tag the version bump, use the corresponding options:
`javascript
// commit:
bumpVersion('stable', { commit: true })
// (commit &) tag:
bumpVersion('stable', { tag: true })
``
---
- TBD
> Format according to https://keepachangelog.com
#### Removed
- node v16 support
#### Changed
- give feedback about current version, too
- small ui changes
- refactoring
#### Added
- give feedback about new version
#### Added
- initial version with basic functionality
---
Licensed under MIT.
Published, Supported and Sponsored by u|screen