$ cnpm install @pnpm/colorize-semver-diff
Makes a colorful semver diff
<pnpm|yarn|npm> add @pnpm/colorize-semver-diff
import colorizeSemverDiff from '@pnpm/colorize-semver-diff'
console.log(colorizeSemverDiff({
change: 'feature',
diff: [['2'], ['1', '0', 'rc', '1']]
}))
Returns a string with ANSI colors.
type: unknown, breaking, feature, fix
type: string[]
An array of version parts that are unchanged. For instance, in a diff between
1.0.0 and 1.2.0 the unchanged part will be ['1'].
type: string[]
An array of version parts that are changed. For instance, in a diff between
1.0.0 and 1.2.0 the changed part will be ['2', '0'].
Copyright 2013 - present © cnpmjs.org | Home |