File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 513
513
* ` s.clean(' 2.1.5 ' )` : ` ' 2.1.5' `
514
514
* ` s.clean(' ~1.0.0' )` : ` null`
515
515
516
+ # # Constants
517
+
518
+ As a convenience, helper constants are exported to provide information about what ` node-semver` supports:
519
+
520
+ # ## `RELEASE_TYPES`
521
+
522
+ - major
523
+ - premajor
524
+ - minor
525
+ - preminor
526
+ - patch
527
+ - prepatch
528
+ - prerelease
529
+
530
+ ` ` `
531
+ const semver = require(' semver' );
532
+
533
+ if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
534
+ console.log(' This is a valid release type!' );
535
+ } else {
536
+ console.warn(' This is NOT a valid release type!' );
537
+ }
538
+ ` ` `
539
+
540
+ # ## `SEMVER_SPEC_VERSION`
541
+
542
+ 2.0.0
543
+
544
+ ` ` `
545
+ const semver = require(' semver' );
546
+
547
+ console.log(' We are currently using the semver specification version:' , semver.SEMVER_SPEC_VERSION);
548
+ ` ` `
549
+
516
550
# # Exported Modules
517
551
518
552
< ! --
@@ -566,3 +600,4 @@ The following modules are available:
566
600
* `require(' semver/ranges/outside' )`
567
601
* `require(' semver/ranges/to-comparators' )`
568
602
* `require(' semver/ranges/valid' )`
603
+
You can’t perform that action at this time.
0 commit comments