semver 0.2.1 copy "semver: ^0.2.1" to clipboard
semver: ^0.2.1 copied to clipboard

Dart 1 only

A 'parser' for valid semantic version tags.

Build Status

A version parser for tags formed after the semantic versioning convention.

Parsing versions #

import 'package:semver/semver.dart';

// from strings
var sm = new SemanticVersion.fromString('0.1.0');

// from maps
var myver = {'major': 10, 'minor': 5, 'patch': 1, build: '200'};
var sm = new SemanticVersion.fromMap(myver);

// directly
var newver = SemanticVersion(20, 10, 0, pre: 'alpha');

Comparing versions #

import 'package:semver/semver.dart';

var sm1 = new SemanticVersion.fromString('0.1.0+200');
var sm2 = new SemanticVersion.fromString('0.1.0+400');

assert(sm1 == sm2); // true

var sm3 = new SemanticVersion.fromString('0.1.0-alpha');
var sm4 = new SemanticVersion.fromString('0.1.0');

assert(sm3 < sm4); // true
0
likes
0
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A 'parser' for valid semantic version tags.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

string_scanner, unittest

More

Packages that depend on semver