{"id":18449423,"url":"https://github.com/public-transport/vbb-sort-lines","last_synced_at":"2025-04-16T19:41:33.922Z","repository":{"id":57390997,"uuid":"87357534","full_name":"public-transport/vbb-sort-lines","owner":"public-transport","description":"Sort VBB lines by their importance.","archived":false,"fork":false,"pushed_at":"2020-05-03T15:58:14.000Z","size":12,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T23:25:59.629Z","etag":null,"topics":["fptf","public-transportation","transport"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/public-transport.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-05T21:19:37.000Z","updated_at":"2024-12-17T15:24:06.000Z","dependencies_parsed_at":"2022-09-19T04:32:12.000Z","dependency_job_id":null,"html_url":"https://github.com/public-transport/vbb-sort-lines","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Fvbb-sort-lines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Fvbb-sort-lines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Fvbb-sort-lines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Fvbb-sort-lines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/public-transport","download_url":"https://codeload.github.com/public-transport/vbb-sort-lines/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249128223,"owners_count":21217103,"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":["fptf","public-transportation","transport"],"created_at":"2024-11-06T07:19:59.020Z","updated_at":"2025-04-15T18:27:49.856Z","avatar_url":"https://github.com/public-transport.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vbb-sort-lines\n\n**Sort VBB lines by their importance.** Implements a heuristic to sort lines based on their mode of transport and name.\n\n[![npm version](https://img.shields.io/npm/v/vbb-sort-lines.svg)](https://www.npmjs.com/package/vbb-sort-lines)\n[![build status](https://img.shields.io/travis/public-transport/vbb-sort-lines.svg)](https://travis-ci.org/public-transport/vbb-sort-lines)\n![ISC-licensed](https://img.shields.io/github/license/public-transport/vbb-sort-lines.svg)\n[![chat on gitter](https://badges.gitter.im/public-transport.svg)](https://gitter.im/public-transport)\n\n\n## Installing\n\n```shell\nnpm install vbb-sort-lines\n```\n\n\n## Usage\n\n`sortLines` compares two `line`s in [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format), so that it works with [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).\n\n```js\nconst sortLines = require('vbb-sort-lines')\n\nconsole.log([\n\t{type: 'line', id: '1', name: '11', mode: 'train'},\n\t{type: 'line', id: '5', name: '300', mode: 'bus'},\n\t{type: 'line', id: '2', name: '100', mode: 'train'},\n\t{type: 'line', id: '4', name: 'M45', mode: 'bus'},\n\t{type: 'line', id: '3', name: '10', mode: 'ferry'}\n].sort(sortLines))\n```\n\n```js\n[\n\t{type: 'line', id: '1', name: '11', mode: 'train'},\n\t{type: 'line', id: '2', name: '100', mode: 'train'},\n\t{type: 'line', id: '3', name: '10', mode: 'ferry'},\n\t{type: 'line', id: '4', name: 'M45', mode: 'bus'},\n\t{type: 'line', id: '5', name: '300', mode: 'bus'}\n]\n```\n\n\n## Contributing\n\nIf you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/public-transport/vbb-sort-lines/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublic-transport%2Fvbb-sort-lines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpublic-transport%2Fvbb-sort-lines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublic-transport%2Fvbb-sort-lines/lists"}