npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rousen/gpxparser

v0.1.4

Published

A TypeScript library for parsing and processing GPX files. Extract track and waypoint information, analyze distance, elevation, slope, and more.

Downloads

117

Readme

GPX Parser

GPX 파일을 파싱하고 처리하기 위한 TypeScript 라이브러리입니다. 트랙과 웨이포인트 정보를 추출하고, 거리, 고도, 경사도 등의 데이터를 분석할 수 있습니다.

주요 기능

  • GPX 파일 파싱 (URL, File, Text 형식 지원)
  • 트랙 정보 추출
    • 트랙 포인트 (위도, 경도, 고도, 시간)
    • 거리 계산
    • 고도 분석 (최대, 최소, 상승, 하강, 평균)
    • 경사도 계산
    • 경계 상자 (bounds) 정보 [minlat, minlon, maxlat, maxlon]
  • 웨이포인트 정보 추출
    • 위치 정보 (위도, 경도, 고도)
    • 메타데이터 (이름, 설명, 시간 등)
    • 커스텀 확장 데이터 지원
  • 전체 GPX 파일의 경계 상자 정보

설치

npm install @rousen/gpxparser

사용 방법

기본 사용법

import GPXParser from "@rousen/gpxparser";

// URL에서 GPX 파일 파싱
const result = await GPXParser.parse({
  url: "https://example.com/track.gpx",
});

// 로컬 파일에서 GPX 파일 파싱
const result = await GPXParser.parse({
  file: fileObject,
});

// 텍스트에서 GPX 파일 파싱
const result = await GPXParser.parse({
  text: gpxString,
});

결과 데이터 구조

interface ParseResult {
  tracks: Track[]; // 트랙 정보 배열
  waypoints: Waypoint[]; // 웨이포인트 정보 배열
  bounds?: [number, number, number, number]; // 전체 GPX 파일의 경계 상자 정보 [minlat, minlon, maxlat, maxlon]
}

interface Track {
  name: string; // 트랙 이름
  points: Point[]; // 트랙 포인트 배열
  distance: Distance; // 거리 정보
  elevation: Elevation; // 고도 정보
  slopes: number[]; // 경사도 배열
  bounds?: [number, number, number, number]; // 트랙의 경계 상자 정보 [minlat, minlon, maxlat, maxlon]
  // ... 기타 메타데이터
}

interface Waypoint {
  name: string; // 웨이포인트 이름
  lat: number; // 위도
  lon: number; // 경도
  ele: number; // 고도
  time: Date; // 시간
  // ... 기타 메타데이터
}