Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jhermsmeier committed Jun 6, 2016
1 parent cbcffc2 commit dcab498
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Flight Designator
[![npm](https://img.shields.io/npm/v/flight-designator.svg?style=flat-square)](https://npmjs.com/flight-designator)
[![npm downloads](https://img.shields.io/npm/dm/flight-designator.svg?style=flat-square)](https://npmjs.com/flight-designator)
[![npm](https://img.shields.io/npm/v/flight-designator.svg?style=flat-square)](https://npmjs.com/package/flight-designator)
[![npm license](https://img.shields.io/npm/l/flight-designator.svg?style=flat-square)](https://npmjs.com/package/flight-designator)
[![npm downloads](https://img.shields.io/npm/dm/flight-designator.svg?style=flat-square)](https://npmjs.com/package/flight-designator)
[![build status](https://img.shields.io/travis/jhermsmeier/node-flight-designator.svg?style=flat-square)](https://travis-ci.org/jhermsmeier/node-flight-designator)

## Install via [npm](https://npmjs.com)

```sh
$ npm install flight-designator
$ npm install --save flight-designator
```

## Usage
Expand All @@ -15,26 +16,43 @@ $ npm install flight-designator
var FlightDesignator = require( 'flight-designator' )
```

```js
FlightDesignator.isValidAirlineCode( 'KLM' )
> true
```

```js
FlightDesignator.isValidFlightNumber( '0180' )
> true
```

```js
FlightDesignator.parse( 'U24511A' )
> {
airlineCode: 'U2',
flightNumber: '4511',
flightNumber: 4511,
operationalSuffix: 'A'
}
```

```js
FlightDesignator.format( 'u2 0350A' )
> 'U2350A'
FlightDesignator.format( 'u2 0350A', true )
> 'U2 350 A'
```

```js
new FlightDesignator( 'KLM', '645' )
> {
airlineCode: 'KLM',
flightNumber: '645',
flightNumber: 645,
operationalSuffix: ''
}
```

```js
var flight = new FlightDesignator( 'LH', '2054', 'X' )
var flight = new FlightDesignator( 'LH', 2054, 'X' )
flight.toString()
> 'LH2054X'
flight.toString( true )
Expand Down

0 comments on commit dcab498

Please sign in to comment.