1.0.1 • Published 4 years ago

@pnpm/colorize-semver-diff v1.0.1

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

@pnpm/colorize-semver-diff

Makes a colorful semver diff

npm version Build Status

Installation

<pnpm|yarn|npm> add @pnpm/colorize-semver-diff

Usage

import colorizeSemverDiff from '@pnpm/colorize-semver-diff'

console.log(colorizeSemverDiff({
  change: 'feature',
  diff: [['2'], ['1', '0', 'rc', '1']]
}))

API

colorizeSemverDiff(semverDiff)

Returns a string with ANSI colors.

semverDiff.change

type: unknown, breaking, feature, fix

semverDiff.diff0

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'].

semverDiff.diff1

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'].

Related

License

MIT © Zoltan Kochan