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 🙏

© 2024 – Pkg Stats / Ryan Hefner

korea-public-village-forecast

v0.2.1

Published

기상청 동네예보 조회서비스 OpenAPI node.js(TypeScript) wrapper

Downloads

285

Readme

개요

공공데이터포털에서 제공하는 기상청_동네예보 조회서비스를 더 용이하기 사용할 수 있도록 wrapping한 라이브러리입니다.


Feature

🕖 조회시간 파라미터 편의성 개선

  • 현재 시간 defualt 값 적용, 발표 시간을 고려한 이전 데이터 조회

🗺️ grid 변환 로직 내장

  • 위경도 -> 격자 테이블 데이터를 관리할 필요 없이 계산하여 자동으로 추론

📃 결과 가공 및 설명 추가

  • 분석 및 애플리케이션에 적용을 용이하기 하기 위해 날짜별 그룹핑, 코드별 맵핑 및 description 추가
  • 가공 전 origin 데이터 조회 on/off 기능

Example

import { VillageForecast } from "korea-public-village-forecast"

const villageForecast = new VillageForecast({
  serviceKey: VILLAGE_FORECAST_KEY,
});

// 초단기실황조회
const result = await villageForecast.getUltraSrtNcst({
  lat: 37.4871167,
  lng: 126.7274377,
  datetime: '2021-05-02 09:00'
});
{
  url: 'http://apis.data.go.kr/1360000/VilageFcstInfoService/getUltraSrtNcst?serviceKey=VILLAGE_FORECAST_KEY&pageNo=1&numOfRows=1024&base_date=20210613&base_time=0900&nx=56&ny=125&dataType=JSON',
  baseDate: '2021-05-02 09:00',
  items: [
    { category: 'PTY',
      value: '0',
      desc: '강수형태',
      valueDesc: '없음'
    },
    { category: 'REH', value: '77', desc: '습도(%)' },
    { category: 'RN1', value: '0', desc: '1시간 강수량(mm)' },
    { category: 'T1H', value: '23.8', desc: '기온(c)' },
    { category: 'UUU', value: '0.6', desc: '풍속(동서성분)' },
    {
      category: 'VEC',
      value: '196',
      desc: '풍향(deg)',
      valueDesc: 'S-SW'
    },
    { category: 'VVV', value: '2', desc: '풍속(남북성분)' },
    { category: 'WSD', value: '2.1', desc: '풍속(m/s)' }
  ],
  origin: null
}

Options

serviceKey : 부여받은 서비스 키(필수)

timeout : 기상청 통신 타임아웃 (기본값: 2000ms)

  • 간헐적으로 기상청 측 response가 매우 느린 경우가 있어 이 부분을 핸들링 할 수 있습니다.

showOrigin : 원본 데이터 표시 여부

  • 가공된 데이터 대신 이전 원본 데이터를 제공합니다.