From 64d00ef27b457ee5522eb0a269bea87f7120b2b5 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 23 Dec 2016 13:34:56 +0700 Subject: [PATCH] Add API section to readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 606562a..a8725d3 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,20 @@ expired(headers) // false ``` +### API + +#### expired(headers) + +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) + +Returns the amount of milliseconds until the resource will expire. If the resource has already expired it will return a negative integer. + +#### expired.on(headers) + +Returns a JavaScript `Date` object for the date the resource will expire. + ## License MIT © Luke Childs