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

trip-recommender

v1.0.2

Published

![triprecommender](https://github.com/user-attachments/assets/305b0962-a857-47fe-bf1e-459aeb6a0b47)

Downloads

14

Readme

Trip-Recommender

triprecommender

소개

특정 주소나 위치를 검색했을 때 ai에게 여행 추천을 받아서 사용자에게 보여주는 라이브러리

설치

$ npm install trip-recommender

Github

Trip-Recommender / Github

샘플

구조

// index.d.ts
declare module 'trip-recommender' {
  ...
  export const ChatResponse: React.FC<ChatResponseProps>;
  export const SelectList: React.FC<SelectListProps>;
  export const RecommendationList: React.FC<RecommendationListProps>;
  export const ChatLoading: React.FC;
  export const Error: React.FC<ErrorProps>;
}

타입

export interface ChatResponseProps {
  keyword: string;
  openAiKey: string;
}
export interface TripActivity {
  placeType: string;
  name: string;
  description: string;
  location: string;
  recommendedMenu?: string;
  link: string;
}
export interface RecommendationType {
  tripType: string;
  tripStyle: string;
  tripActivities: TripActivity[];
}
export interface RecommendationListProps {
  recommendation: RecommendationType;
}
export interface SelectListProps {
  onSelection: (who: string[], interest: string[]) => void;
}
export interface ChatResponseType {
  destination: string;
  recommendation: RecommendationType;
}

export interface ErrorProps {
  message: string;
}

ChatResponse

선택된 장소, 위치와 관련되어 ai의 여행 추천을 보여주는 컴포넌트

<ChatResponse
  keyword={keyword}
  openAiKey={OPEN_AI_KEY}
/>

Props

| 이름 | 설명 | 타입 | 기타 | | ----------- | ------------------------------- | ------ | ---- | | keyword | 여행 추천에 사용될 검색 keyword | String | | | openAiKey | open ai에서 발급받은 secret key | String | |

SelectList

사용자의 요구 조건을 최대한 근접한 답변을 내놓기 위한 추가 선택을 위한 옵션들을 보여주는 컴포넌트

<SelectList onSelection={handleSelection} />

Props

| 이름 | 설명 | 타입 | 기타 | | ----------------- | -------------------------------- | --------------- | ---- | | handleSelection | 선택되는 추가 옵션을 다루는 함수 | SelectListProps | |

예시

selectList

RecommendationList

open ai의 응답 결과 값을 이용하여 추천 일정 을 보여주는 컴포넌트

<RecommendationList response={response} />

Props

| 이름 | 설명 | 타입 | 기타 | | ---------- | -------------------------- | ---------------- | ---- | | response | open ai의 JSON 형태의 응답 | ChatResponseType | |

예시

recommendationList

ChatLoading

ai 답변이 오기전 로딩 화면

<ChatLoading />

예시

loading

Error

error에 대한 화면을 보여주는 컴포넌트

<Error message={message} />

Props

| 이름 | 설명 | 타입 | 기타 | | ---------- | -------------------------- | ---------------- | ---- | | message | error 메세지 | string | |

예시

error