
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
gpx-parser-builder
Advanced tools
A simple gpx parser and builder between GPX string and JavaScript object
A simple gpx parser and builder between GPX string and JavaScript object. It is dependent on fast-xml-parser.
gpx-parser-builder is written with ECMAScript 6 and is now an ES Module.
npm install gpx-parser-builder --save
import GPX from 'gpx-parser-builder';
// Parse gpx
const gpx = GPX.parse('GPX_STRING');
window.console.dir(gpx.metadata);
window.console.dir(gpx.wpt);
window.console.dir(gpx.trk);
// Build gpx
window.console.log(gpx.toString());
Get more details about usage with the unit tests.
The GPX JavaScript object.
constructor(object)
const gpx = new Gpx({$:{...}, metadat: {...}, wpt:[{...},{...}]}, trk: {...}, rte: {...})
$ the attributes for the gpx element. Default value:
{
'version': '1.1',
'creator': 'gpx-parser-builder',
'xmlns': 'http://www.topografix.com/GPX/1/1',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation': 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd'
}
metadata the metadata for the gpx.
wpt array of waypoints. It is corresponded to <wpt>. The type of all elements in wpt is Waypoint;
rte array of routes. It is corresponded to <rte>. The type of all elements in rte is Route;
trk array of tracks. It is corresponded to <trk>. The type of all elements in trk is Track;
parse(gpxString, options) parse gpx string to Gpx object. return null if parsing failed. The options is for fast-xml-parser's XMLParser.
toString(options) GPX object to gpx string. The options is for fast-xml-parser's XMLBuilder.
You can leverage StreamSaver.js or FileSaver.js to save as GPX file. ⚠️Not all borwsers support the above file techniques. ⚠️️️
Ke Zheng-Xiang, kf99916@gmail.com
gpx-parser-builder is available under the MIT license. See the LICENSE file for more info.
FAQs
A simple gpx parser and builder between GPX string and JavaScript object
The npm package gpx-parser-builder receives a total of 537 weekly downloads. As such, gpx-parser-builder popularity was classified as not popular.
We found that gpx-parser-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.