Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.markdown 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # semver-compare
  2. compare two semver version strings, returning -1, 0, or 1
  3. The return value can be fed straight into `[].sort`.
  4. [![build status](https://secure.travis-ci.org/substack/semver-compare.png)](http://travis-ci.org/substack/semver-compare)
  5. # example
  6. ``` js
  7. var cmp = require('semver-compare');
  8. var versions = [
  9. '1.2.3',
  10. '4.11.6',
  11. '4.2.0',
  12. '1.5.19',
  13. '1.5.5',
  14. '4.1.3',
  15. '2.3.1',
  16. '10.5.5',
  17. '11.3.0'
  18. ];
  19. console.log(versions.sort(cmp).join('\n'));
  20. ```
  21. prints:
  22. ```
  23. 1.2.3
  24. 1.5.5
  25. 1.5.19
  26. 2.3.1
  27. 4.1.3
  28. 4.2.0
  29. 4.11.6
  30. 10.5.5
  31. 11.3.0
  32. ```
  33. whereas the default lexicographic sort (`versions.sort()`) would be:
  34. ```
  35. 1.2.3
  36. 1.5.19
  37. 1.5.5
  38. 10.5.5
  39. 11.3.0
  40. 2.3.1
  41. 4.1.3
  42. 4.11.6
  43. 4.2.0
  44. ```
  45. # methods
  46. ```
  47. var cmp = require('semver-compare')
  48. ```
  49. ## cmp(a, b)
  50. If the semver string `a` is greater than `b`, return `1`.
  51. If the semver string `b` is greater than `a`, return `-1`.
  52. If `a` equals `b`, return 0;
  53. # install
  54. With [npm](https://npmjs.org) do:
  55. ```
  56. npm install semver-compare
  57. ```
  58. # license
  59. MIT