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

eleventy-plugin-airport-shortcode

v1.0.4

Published

An Eleventy plugin that adds an airport shortcode for displaying airport information with IATA codes

Downloads

19

Readme

eleventy-plugin-airport-shortcode

An Eleventy plugin that adds an {% airport %} shortcode for displaying airport information using IATA airport codes.

Installation

npm install eleventy-plugin-airport-shortcode

Usage

Add the plugin to your .eleventy.js configuration file:

import airportPlugin from 'eleventy-plugin-airport-shortcode';

export default function(eleventyConfig) {
    eleventyConfig.addPlugin(airportPlugin);
    
    // Your other configuration...
}

Then use the shortcode in your templates:

{% airport "YYZ" %}
{% airport "LAX" %}
{% airport "LHR" %}

More Examples

<!-- Major international airports -->
{% airport "JFK" %} - John F. Kennedy International Airport
{% airport "CDG" %} - Charles de Gaulle Airport
{% airport "NRT" %} - Narita International Airport
{% airport "SYD" %} - Sydney Kingsford Smith Airport

<!-- Travel blog example -->
Flying from {% airport "YVR" %} to {% airport "FCO" %} via {% airport "FRA" %} 
was an amazing journey through three different time zones.

<!-- Invalid codes (shows error message) -->
{% airport "XYZ" %} - Will show "XYZ (airport not found)"

Output

The shortcode generates HTML like this:

<span class="airport-summary">
    <span class="airport-summary__code" title="Lester B. Pearson International Airport">YYZ</span>
    <span class="airport-summary__location">Toronto, Canada</span>
</span>

Configuration

You can customize the plugin behavior by passing options:

eleventyConfig.addPlugin(airportPlugin, {
    shortcodeName: 'airport',        // Change the shortcode name (default: 'airport')
    errorPrefix: 'airport not found', // Custom error message (default: 'airport not found')  
    showError: true                  // Show error messages for invalid codes (default: true)
});

Options

  • shortcodeName (string, default: 'airport'): The name of the shortcode
  • errorPrefix (string, default: 'airport not found'): Custom error message for unknown airport codes
  • showError (boolean, default: true): Whether to display error messages for invalid codes

CSS Styling

The plugin generates HTML with these CSS classes that you can style:

.airport-summary {
    /* Container for the entire airport display */
    display: inline-block;
}

.airport-summary-code {
    /* Styles for the airport code (e.g., "YYZ") */
    font-weight: bold;
    font-family: monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.airport-summary-location {
    /* Styles for city, country (e.g., "Toronto, Canada") */
    color: #666;
    margin-left: 0.5em;
    font-size: 0.9em;
}

Example Styling for Travel Blogs

.airport-summary {
    display: inline-block;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.airport-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.airport-summary-code {
    color: #2c5aa0;
    font-weight: bold;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 1.1em;
}

.airport-summary-location {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-top: 2px;
}

Data Source

This plugin uses the airport-codes npm package, which provides comprehensive IATA airport code data.

Requirements

  • Node.js 18.0.0 or higher
  • Eleventy 2.0.0 or higher

License

MIT