dart-semver

Semantic Versioning Tag Parser for Dart

3 years after

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

Related Repositories

ngInfiniteScroll

ngInfiniteScroll

Infinite Scrolling for AngularJS ...

awesome-guidelines

awesome-guidelines

A curated list of high quality coding style conventions and standards. ...

stringmetric

stringmetric

:dart: String metrics and phonetic algorithms for Scala (e.g. Dice/Sorensen, Ham ...

mustache4dart

mustache4dart

mustache implementation for Dart ...

dart_dev

dart_dev

...


Top Contributors

guillermooo