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 🙏

© 2026 – Pkg Stats / Ryan Hefner

itinerary-generator

v1.0.19

Published

A React component for generating travel itineraries

Downloads

11

Readme

Itinerary Generator

A React component library for generating travel itineraries based on user inputs. Perfect for travel applications, booking websites, and trip planning tools.

Installation

Install the package using npm:

npm install itinerary-generator

Or using yarn:

yarn add itinerary-generator

Features

  • 🌍 Generate complete travel itineraries for any destination
  • 📅 Support for customizable date ranges
  • 👥 Accommodates adults, children, and infants
  • 🔑 API key integration for secure access
  • 📱 Responsive design that works on all devices
  • 📝 Detailed daily plans with a single main activity, meal suggestions, and estimated costs
  • 🎯 Customizable preferences for activities and budget type

Quick Start

Basic Usage

import React from 'react';
import ItineraryForm from 'itinerary-generator';

function App() {
  const handleItineraryData = (data) => {
    console.log('Received itinerary data:', data);
    // Process or display the itinerary data
  };

  return (
    <div className="App">
      <h1>Plan Your Trip</h1>
      <ItineraryForm
        apiKey="your-api-key-here"
        onDataReceived={handleItineraryData}
        formDetails={{
          departureCity: 'New York',
          arrivalCity: 'Paris',
          departureDate: '2025-06-10',
          arrivalDate: '2025-06-20',
          travelers: {
            adults: 2,
            children: 1,
            infants: 0,
          },
          preferences: {
            activities: ['City sightseeing', 'Historical sites', 'Shopping'],
            budgetType: 'Mid-range',
          },
        }}
      />
    </div>
  );
}

export default App;

API Reference

<ItineraryForm> Props

| Prop | Type | Required | Description | |----------------|---------|----------|----------------------------------------------| | apiKey | string | Yes | Your API key for authentication | | onDataReceived | function| Yes | Callback function that receives itinerary data | | formDetails | object | Yes | Details about the trip (see below) | | key | string | No | React key for the component (optional) |

formDetails Object

| Property | Type | Required | Description | |---------------|--------|----------|------------------------------------------| | departureCity | string | Yes | The departure city | | arrivalCity | string | Yes | The arrival city (destination) | | departureDate | string | Yes | Trip start date in 'YYYY-MM-DD' format | | arrivalDate | string | Yes | Trip end date in 'YYYY-MM-DD' format | | travelers | object | Yes | Number of travelers | | preferences | object | Yes | Travel preferences (activities, budget) |

travelers Object

| Property | Type | Required | Description | |----------|------|----------|--------------------| | adults | number | Yes | Number of adults | | children | number | Yes | Number of children | | infants | number | Yes | Number of infants |

preferences Object

| Property | Type | Required | Description | |------------|---------|----------|-------------------------------------------------| | activities | string[] | Yes | Preferred activities (e.g., sightseeing, shopping) | | budgetType | string | Yes | Budget type: 'Budget', 'Mid-range', or 'Luxury' |

Returned Itinerary Data Structure

The onDataReceived callback receives an object with the following structure:

interface ItineraryResult {
  departure_city: string;
  arrival_city: string;
  departure_date: string;
  arrival_date: string;
  travelers: {
    adults: number;
    children: number;
    infants: number;
  };
  budget_type: 'Budget' | 'Mid-range' | 'Luxury';
  itinerary: ItineraryDay[];
}

interface ItineraryDay {
  day: number;
  date: string;
  activity: string;
  location: string;
  meal_suggestions: string[];
  estimated_cost: number;
  additional_notes: string;
}

Examples

With Travel Preferences

<ItineraryForm
  apiKey="your-api-key-here"
  onDataReceived={handleItineraryData}
  formDetails={{
    departureCity: 'New York',
    arrivalCity: 'Paris',
    departureDate: '2025-06-10',
    arrivalDate: '2025-06-20',
    travelers: {
      adults: 2,
      children: 1,
      infants: 0,
    },
    preferences: {
      activities: ['City sightseeing', 'Historical sites', 'Shopping'],
      budgetType: 'Mid-range',
    },
  }}
/>

Handling the Returned Data

import React, { useState } from 'react';
import ItineraryForm from 'itinerary-generator';

function TripPlanner() {
  const [itinerary, setItinerary] = useState(null);

  const handleItineraryData = (data) => {
    setItinerary(data);
  };

  return (
    <div>
      <h1>Trip Planner</h1>
      <ItineraryForm
        apiKey="your-api-key-here"
        onDataReceived={handleItineraryData}
        formDetails={{
          departureCity: 'New York',
          arrivalCity: 'Paris',
          departureDate: '2025-06-10',
          arrivalDate: '2025-06-20',
          travelers: {
            adults: 2,
            children: 1,
            infants: 0,
          },
          preferences: {
            activities: ['City sightseeing', 'Historical sites', 'Shopping'],
            budgetType: 'Mid-range',
          },
        }}
      />
      {itinerary && itinerary.itinerary.map((day, index) => (
        <div key={index}>
          <h3>Day {day.day}: {day.date}</h3>
          <p><strong>Activity:</strong> {day.activity}</p>
          <p><strong>Location:</strong> {day.location}</p>
          <p><strong>Meal Suggestions:</strong> {day.meal_suggestions.join(', ')}</p>
          <p><strong>Estimated Cost:</strong> ${day.estimated_cost} per person</p>
        </div>
      ))}
    </div>
  );
}

export default TripPlanner;

API Key

To obtain an API key, visit our developer portal and register for an account.

Contributing

We welcome contributions! See CONTRIBUTING.md for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.