{"id":20972028,"url":"https://github.com/fabulator/gpx-builder","last_synced_at":"2025-04-05T10:07:21.432Z","repository":{"id":39458542,"uuid":"128945596","full_name":"fabulator/gpx-builder","owner":"fabulator","description":"Builder of GPX files","archived":false,"fork":false,"pushed_at":"2025-03-27T16:59:13.000Z","size":3331,"stargazers_count":43,"open_issues_count":6,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T09:08:34.528Z","etag":null,"topics":["gps","gpx","gpx-builder","location","xml"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabulator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-10T14:22:46.000Z","updated_at":"2025-03-16T21:45:24.000Z","dependencies_parsed_at":"2023-10-02T01:34:44.263Z","dependency_job_id":"079906c2-4dfd-4610-9ebe-92ff783735d9","html_url":"https://github.com/fabulator/gpx-builder","commit_stats":{"total_commits":311,"total_committers":10,"mean_commits":31.1,"dds":0.639871382636656,"last_synced_commit":"3b32ffeb6d1ca9595e9ca1d0e011f092784e11f0"},"previous_names":[],"tags_count":88,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulator%2Fgpx-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulator%2Fgpx-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulator%2Fgpx-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulator%2Fgpx-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabulator","download_url":"https://codeload.github.com/fabulator/gpx-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"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":["gps","gpx","gpx-builder","location","xml"],"created_at":"2024-11-19T04:06:17.962Z","updated_at":"2025-04-05T10:07:21.413Z","avatar_url":"https://github.com/fabulator.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPX builder\n\n[![npm](https://img.shields.io/npm/v/gpx-builder.svg)](https://www.npmjs.com/package/gpx-builder) \n\nThis library creates GPX version 1.1 files. I recommend you to check full [documentation on topografix](http://www.topografix.com/gpx/1/1/). The library has option to use Garmin extensions, so you can add cadence, heart rate, speed and other fitness data to your points.\n\nIntegration for Strava allows to use some non-standard metric as power. That XML is not valid by standard, but it's the way that Strava use it.\n\n## How to use it\n\nInstall:\n\n```nodedaemon\nnpm install gpx-builder\n```\n\nCreate your first GPX file:\n\n```javascript\nconst { buildGPX, GarminBuilder } = require('gpx-builder');\n\nconst { Point } = GarminBuilder.MODELS;\n\nconst points = [\n    new Point(51.02832496166229, 15.515156626701355, {\n        ele: 314.715,\n        time: new Date('2018-06-10T17:29:35Z'),\n        hr: 120,\n    }),\n    new Point(51.12832496166229, 15.615156626701355, {\n        ele: 314.715,\n        time: new Date('2018-06-10T17:39:35Z'),\n        hr: 121,\n    }),\n];\n\nconst gpxData = new GarminBuilder();\n\ngpxData.setSegmentPoints(points);\n\nconsole.log(buildGPX(gpxData.toObject()));\n\n```\n\nUse Strava format that supports power and distance on top of Garmin standard properties.\n\n```javascript\nconst { StravaBuilder } = require('gpx-builder');\nconst { Point } = StravaBuilder.MODELS;\n\nconst points = [\n    new Point(51.02832496166229, 15.515156626701355, {\n        ele: 314.715,\n        time: new Date('2018-06-10T17:29:35Z'),\n        hr: 120,\n        power: 5,\n        distance: 1,\n    }),\n];\n```\n\n### How the library works\n\nLibrary contains two types of classes:\n\n- `Creators` - They create xml string from defined Object structure\n- `Builders` - They offer user friendly way to create data for creators\n\nLibrary contains three Builders:\n\n- BaseBuilder - To create GPX 1.1 valid files. [Check all the properties you can add to GPX](https://github.com/fabulator/gpx-builder/blob/master/src/builder/BaseBuilder/BaseBuilder.ts).\n- GarminBuilder - To use [TrackPointExtensionv2 schema](https://www8.garmin.com/xmlschemas/TrackPointExtensionv2.xsd) from Garmin.\n- StravaBuilder - To extends GPX by data that uses Strava.\n\nTypes\n\nWhat you find in [type file](https://github.com/fabulator/gpx-builder/blob/master/src/types.ts) are types that are used as object for builders. Eg. you can create object based on `WayPoint` and use it directly to creator. You can also use `Point` class in builder section that has more developer friendly constructor. It will convert you data to `WayPoint` type.   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabulator%2Fgpx-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabulator%2Fgpx-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabulator%2Fgpx-builder/lists"}