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

flights-search-cli

v1.2.0

Published

Search Flights From Your Terminal

Downloads

69

Readme

flights-search-cli

Flights Search CLI codecov npm npm bundle size npm-total-downloads GitHub

alt-text alt-text

Search flights from the command line!

Install

npm install flights-search-cli --global

Usage

  1. flights search triggers the command line tool
  2. Follow the instructions to
  • Select what airport you're flying from
  • Select what airport you're flying to
  • The departure date range that you're searching over
  • The departure time of day you're searching over (i.e. "I only want to look for flights between 3-6 PM")
  • Select if you only want to look at round-trip flights
  • Select maximum total price of flights in USD
  • Select if you only want to look at direct flights
  1. You'll (hopefully) get a list of flights - after selecting one, you'll be taken to a kiwi.com booking page

kiwi-booking

Specifying Command Line Arguments

  • Instead of following the prompts every single time, you can also take advantage of the following command line arguments
  • -s <IATA Airport Code> or --start-airport <IATA Airport Code> sets the departure airport
    • Like -s SFO or --start-airport SFO
  • -e <IATA Airport Code> or --end-airport <IATA Airport Code> sets the arriving airport
    • -e SFO or --end-airport SFO
  • -l <Departure Window> or --leaving-between <Departure Window> sets the date(s) or datetime(s) for departure
    • Like -l 2019-09-01 or --leaving-between 2019-09-01
    • Can specify a start and an end to a window using the | delimiter like (-l "2019-09-01|2019-09-07")
    • Can also specify a datetime window like -l "2019-09-01T11:30|2019-09-07T14:30" which would look at all departure times between 11:30 AM on 2019-09-01 to 2:30 PM on 2019-09-07
    • Dates need to follow the HTML5 date format (YYYY-MM-DD) and datetimes need to follow the HTML5 datetime format (YYYY-MM-DDTHH:mm)
  • -r <Departure Window> or --returning-between <Departure Window> works exactly the same as the --leaving-between argument, except for return flights
  • -$ <price> or --max-price <price> filters out tickets above a certain price in USD
    • Like -$ 500 or --max-price 500
  • -d or --direct-flight filters out flights that are not direct
    • It's a boolean flag, so simply specifying the flag is sufficient - there does not need to be a value associated with the argument
  • -1 or --one-way only calculates flights from the departing airport to the arrival airport
    • If a returning departure window is specified and this boolean flag is specified, the returning departure window will take precedence

Development

flights-search-cli uses nvm to manage node and npm versions.

Ensure that you have nvm installed, and have the correct node version defined in the .nvmrc file.

To build the project locally

  1. Execute the compile command defined in the package.json file
    • This should execute the Babel transpilation process and output files to the build directory
  2. Execute the npm link command
    • This should symlink the bin executable file (build/executables/flights.js)
  3. Execute any of the commands (like flights search)

After making changes to the source code, you will need to rebuild the project and re-link the updated build files in order to test any changes you've made to the source code.

Git Hooks

This project uses husky to maintain git hooks.

  • pre-commit - run source code linting and commit message linting

Commit Linting

This project uses semantic-release and commitlint (specifically the Angular commit convention) to automatically enforce semantic versioning.

Why kiwi.com?

Because they provide a pretty simple REST API to search for flights.