@nativecode/latest-version
v3.3.1
Published
Library for helping with versions
Downloads
12
Readme
latest-version
The primary purpose of this package originally was to provide a common framework and set of interfaces to connect to various version providers.
Install
npm add @nativecode/latest-version
Getting Started
import LatestVersion from "@nativecode/latest-version"
const provider = LatestVersion.get("dockerhub")
const filter = await provider.list({ user: <username>, name: <image_name> })
console.log(filter.released().array)
console.log(filter.not.released().array)
console.log(filter.released().latest)
Providers
DockerHubProvider
- a provider that supports Docker HubGitHubProvider
- a provider that supports GitHub
Parsers
The default parsers will parse the version into a common VersionInfo
object.
ParseSemVer
- Parses a version using thesemver
libraryParseSemVerEx
- Parses a version using a custom parser to allow extended semver semanticsParseVersion
- Parses a standardx.x.x.x
format of versions
Filter
VersionInfoFilter
class provides a fluent filter that is returned by the list
method from the provider.