Skip to content

Commit

Permalink
Update API docs with function args
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Jan 7, 2017
1 parent 880fffc commit 564cff2
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions README.md
Expand Up @@ -87,18 +87,50 @@ expired.on(headers)

## API

### expired(headers)
### expired(headers, [date])

Returns a boolean relating to whether the resource has expired or not. `true` means it's expired, `false` means it's fresh.

### expired.in(headers)
#### headers

Type: `string`, `object`<br>

String or object containing HTTP headers.

#### date

Type: `Date`<br>
Default: `new Date()`

Optional `Date` object to compare against.

### expired.in(headers, [date])

Returns the amount of milliseconds from the current date until the resource will expire. If the resource has already expired it will return a negative integer.

#### headers

Type: `string`, `object`<br>

String or object containing HTTP headers.

#### date

Type: `Date`<br>
Default: `new Date()`

Optional `Date` object to compare against.

### expired.on(headers)

Returns a JavaScript `Date` object for the date the resource will expire.

#### headers

Type: `string`, `object`<br>

String or object containing HTTP headers.

## License

MIT © Luke Childs

0 comments on commit 564cff2

Please sign in to comment.