egantz / skyscanner-promise-browse

A JS wrapper around the Skyscanner API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skyscanner Promise Browse

Build Status dependencies Status devDependencies Status License: MIT

Usage

See examples. Three methods exposed:

getLocationCode

As per Skyscanner API docs:

Get a list of places that match a query string.

Takes one required argument query which can be any place or address. Also takes three optional arguments (defaults in brackets):

  • country ('UK')
  • currency ('GBP')
  • locale ('en-UK')

browseQuotes

As per Skyscanner API docs:

Retrieve the cheapest quotes from our cache prices.

Takes one required argument origin which can be an airport, city or country.Also takes seven optional arguments (defaults in brackets):

  • destinationAirport ('anywhere')
  • outboundDate ('anytime')
  • returnDate ('anytime')
  • country ('UK')
  • currency ('GBP')
  • locale ('en-UK')
  • maxNumberOfOptions (10)

browseRoutes

As per Skyscanner API docs:

Retrieve the cheapest routes from our cache prices. Similar to the Browse Quotes API but with the routes built for you from the individual quotes.

Takes one required argument origin which can be an airport, city or country. Also takes six optional arguments (defaults in brackets):

  • destinationAirport ('anywhere')
  • outboundDate ('anytime')
  • returnDate ('anytime')
  • country ('UK')
  • currency ('GBP')
  • locale ('en-UK')
  • maxNumberOfOptions (10)

Commands

  • npm run clean - Remove lib/ directory
  • npm test - Run tests with linting and coverage results.
  • npm test:only - Run tests without linting or coverage.
  • npm test:watch - You can even re-run tests on file changes!
  • npm test:prod - Run tests with minified code.
  • npm run test:examples - Test written examples on pure JS for better understanding module usage.
  • npm run lint - Run ESlint with airbnb-config
  • npm run cover - Get coverage report for your code.
  • npm run build - Babel will transpile ES6 => ES5 and minify the code.
  • npm run prepublish - Hook for npm. Do all the checks before publishing your module.

Boiler plate ripped from flexdinesh/npm-module-boilerplate.

About

A JS wrapper around the Skyscanner API

License:MIT License


Languages

Language:JavaScript 100.0%