{"id":17771430,"url":"https://github.com/rootslab/hoar","last_synced_at":"2025-05-12T23:42:31.297Z","repository":{"id":16901307,"uuid":"19662205","full_name":"rootslab/hoar","owner":"rootslab","description":"Hoar, a light semantic versioning parser/comparator.","archived":false,"fork":false,"pushed_at":"2018-02-10T14:40:55.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T23:42:25.648Z","etag":null,"topics":["semver","semver-format","versioning"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootslab.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-11T08:52:36.000Z","updated_at":"2017-12-05T13:45:11.000Z","dependencies_parsed_at":"2022-08-25T12:40:12.057Z","dependency_job_id":null,"html_url":"https://github.com/rootslab/hoar","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhoar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhoar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhoar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhoar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootslab","download_url":"https://codeload.github.com/rootslab/hoar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843168,"owners_count":21972867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["semver","semver-format","versioning"],"created_at":"2024-10-26T21:32:51.968Z","updated_at":"2025-05-12T23:42:31.272Z","avatar_url":"https://github.com/rootslab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Hoar\n\n[![NPM VERSION](http://img.shields.io/npm/v/hoar.svg?style=flat)](https://www.npmjs.org/package/hoar)\n[![CODACY BADGE](https://img.shields.io/codacy/b18ed7d95b0a4707a0ff7b88b30d3def.svg?style=flat)](https://www.codacy.com/public/44gatti/hoar)\n[![CODECLIMATE-TEST-COVERAGE](https://img.shields.io/codeclimate/c/rootslab/hoar.svg?style=flat)](https://codeclimate.com/github/rootslab/hoar)\n[![LICENSE](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rootslab/hoar#mit-license)\n\n![NODE VERSION](https://img.shields.io/node/v/hoar.svg)\n[![TRAVIS CI BUILD](http://img.shields.io/travis/rootslab/hoar.svg?style=flat)](http://travis-ci.org/rootslab/hoar)\n[![BUILD STATUS](http://img.shields.io/david/rootslab/hoar.svg?style=flat)](https://david-dm.org/rootslab/hoar)\n[![DEVDEPENDENCY STATUS](http://img.shields.io/david/dev/rootslab/hoar.svg?style=flat)](https://david-dm.org/rootslab/hoar#info=devDependencies)\n\n[![NPM MONTHLY](http://img.shields.io/npm/dm/hoar.svg?style=flat)](http://npm-stat.com/charts.html?package=hoar)\n![NPM YEARLY](https://img.shields.io/npm/dy/hoar.svg)\n\n[![NPM GRAPH](https://nodei.co/npm/hoar.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/hoar/)\n\n\u003e **_Hoar_**, a fast and light semantic versioning parser/comparator.\n\n\u003e A **_semantic version_**, or **_semver_**, is described by the **v2.0.0** specification found at __http://semver.org/__ or at this __[github repo](https://github.com/mojombo/semver/blob/master/semver.md)__.\n\n### Install\n\n```bash\n$ npm install hoar [-g]\n// clone repo\n$ git clone git@github.com:rootslab/hoar.git\n```\n\n\u003e __require__ returns an helper hash/obj.\n\n```javascript\nvar Hoar  = require( 'hoar' );\n```\n\n### Run Tests\n\n```bash\n$ cd hoar/\n$ npm test\n```\n\n### Sample Usage\n\n\u003e See [examples](example/).\n\n\n### Methods\n\n\u003e Arguments within [ ] are optional, '|' indicates multiple type for an argument.\n\n```javascript\n/*\n * Compare 2 versions with a condition.\n * A version could be also specified through an Array like: [ 1, 0, 0 ].\n * Following conditions are supported: '=', '\u003c', '\u003e', '\u003c=', '\u003e=', '\u003c\u003e'\n *\n * NOTE: it is compliant with all precedence rules specified in the\n * \"Semver 2.0\" specification.\n */\nHoar#compare( String version1 | Array semver1, String version2 | Array semver2, String condition ) : Boolean\n\n/*\n * Some #compare shortcuts for '=', '\u003c', '\u003e', '\u003c=', '\u003e=', '\u003c\u003e'\n */\nHoar#eq( String v1 | Array semver1, String v2 | Array semver2 ) : Boolean\n\nHoar#lt( String v1 | Array semver1, String v2 | Array semver2 ) : Boolean\n\nHoar#gt( String v1 | Array semver1, String v2 | Array semver2 ) : Boolean\n\nHoar#lte( String v1 | Array semver1, String v2 | Array semver2 ) : Boolean\n\nHoar#gte( String v1 | Array semver1, String v2 | Array semver2 ) : Boolean\n\nHoar#neq( String v1 | Array semver1, String v2 | Array semver2 ) : Boolean\n\n/*\n * Check if a version, or a list of versions, is/are between a range.\n * The range is specified as a 2-element Array; elements respectively\n * represent the lower and the higher bounds for a version range.\n *\n * NOTE: for default, strict ('\u003c','\u003e') operators are used for range\n * comparisons, optionally you can use the 'nostrict' option:\n *\n * - 0, for range[ 0 ] \u003c  version \u003c  range[ 1 ]\n * - 1, for range[ 0 ] \u003c= version \u003c  range[ 1 ]\n * - 2, for range[ 0 ] \u003c  version \u003c= range[ 1 ]\n * - 3, for range[ 0 ] \u003c= version \u003c= range[ 1 ]\n */\nHoar#range( String version | Array versions, Array range [, Number nostrict [, Boolean debug ] ] ) : Boolean\n\n/*\n * Parse a version string, optionally specifying an array for result,\n * and/or a filter function to be applied to every identifier.\n * It splits the string into a nested Array containing all elements\n * parsed.\n *\n * NOTE: For default filter function gets the current string parsed and\n * removes all non alpha-numeric chars, then convert a string representation\n * of a number to a Number.\n *\n * Example:\n *\n * A call to parse produces a list of 1 or 2 arrays, the first containing\n * the normal version identifiers, the second containing pre-release\n * identifiers, if any exist ( sub-string after '-' ).\n * List of identifiers about build meta data ( sub-string after '+' ),\n * will be pushed to the 'normal version' or 'pre-release version' array.\n *\n * parse( \"1.0.1-pre.1.x+build001\" );\n *\n * [ [ 1, 0, 1 ], [ 'pre', 1,'x', [ 'build001' ] ] ]\n *\n */\nHoar#parse( String version [, Array result [, Function filter ] ] ) : Array\n\n/*\n * printing infos about a #parse result: Hoar.print( Hoar.parse( '..' ) );\n */\nHoar#print( Array semver ) : undefined\n\n\n```\n\n------------------------------------------------------------------------\n\n\n### MIT License\n\n\u003e Copyright (c) 2013-present \u0026lt; Guglielmo Ferri : 44gatti@gmail.com \u0026gt;\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining\n\u003e a copy of this software and associated documentation files (the\n\u003e 'Software'), to deal in the Software without restriction, including\n\u003e without limitation the rights to use, copy, modify, merge, publish,\n\u003e distribute, sublicense, and/or sell copies of the Software, and to\n\u003e permit persons to whom the Software is furnished to do so, subject to\n\u003e the following conditions:\n\n\u003e __The above copyright notice and this permission notice shall be\n\u003e included in all copies or substantial portions of the Software.__\n\n\u003e THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n\u003e EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\u003e MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\u003e IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\u003e CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\u003e TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\u003e SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fhoar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootslab%2Fhoar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fhoar/lists"}