This package has been deprecated

Author message:

no longer maintained

openflights-loader
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

OpenFlights loader

A Webpack loader for OpenFlights-formatted data

Summary

This Webpack loader allows you to load OpenFlights formatted data.

It is not produced by OpenFlights - check them out here and here!

  1. Add loader to your Webpack config.

    webpack.config.js:

    module.exports = {
      module: {
        rules: [
          {
            test: /airports.dat$/i,
            loader: 'openflights-loader',
          },
        ],
      },
    }
  2. Import and use. You can download data from here.

    import airports from './airports.dat'
    
    console.log(airports[0].name)
  3. If using TypeScript, you may add the following declaration for typed imports:

    declare module '*/airports.dat' {
      import { Airport } from 'openflights-loader'
    
      const _default: Airport[]
      export default _default
    }

Note: This has been developed to suit my needs but additional use cases and contributions are very welcome.

MIT License - Copyright © Daniel Roe

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i openflights-loader

    Weekly Downloads

    0

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    8.97 kB

    Total Files

    7

    Last publish

    Collaborators

    • danielroe