Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gpx-builder
Advanced tools
This library creates GPX version 1.1 files. I recommend you to check full documentation on topografix. The library has option to use Garmin extensions, so you can add cadence, heart rate, speed and other fitness data to your points.
Integration 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.
Install:
npm install gpx-builder
Create your first GPX file:
const { buildGPX, GarminBuilder } = require('gpx-builder');
const { Point } = GarminBuilder.MODELS;
const points = [
new Point(51.02832496166229, 15.515156626701355, {
ele: 314.715,
time: new Date('2018-06-10T17:29:35Z'),
hr: 120,
}),
new Point(51.12832496166229, 15.615156626701355, {
ele: 314.715,
time: new Date('2018-06-10T17:39:35Z'),
hr: 121,
}),
];
const gpxData = new GarminBuilder();
gpxData.setSegmentPoints(points);
console.log(buildGPX(gpxData.toObject()));
Use Strava format that supports power and distance on top of Garmin standard properties.
const { StravaBuilder } = require('gpx-builder');
const { Point } = StravaBuilder.MODELS;
const points = [
new Point(51.02832496166229, 15.515156626701355, {
ele: 314.715,
time: new Date('2018-06-10T17:29:35Z'),
hr: 120,
power: 5,
distance: 1,
}),
];
Library contains two types of classes:
Creators
- They create xml string from defined Object structureBuilders
- They offer user friendly way to create data for creatorsLibrary contains three Builders:
Types
What you find in type file 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.
FAQs
Builder of GPX files
The npm package gpx-builder receives a total of 3,576 weekly downloads. As such, gpx-builder popularity was classified as popular.
We found that gpx-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.