# expires

> Simple expiration helper

Latest version **0.0.1** (published 2013-10-25) · MIT/GPL license · 0 weekly downloads

## Install

```sh
npm install expires
pnpm add expires
yarn add expires
bun add expires
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2013-10-25 |
| First published | 2012-07-01 |
| Weekly downloads | 0 |
| License | MIT/GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | James Brumond |
| Maintainers | k |
| Keywords | expiration, timestamp, date |

## Links

- npm: https://www.npmjs.com/package/expires
- Repository: https://github.com/UmbraEngineering/node-expires
- Issues: https://github.com/UmbraEngineering/node-expires/issues
- npm.io page: https://npm.io/package/expires

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2013-10-25
- 0.0.0 — 2012-07-01

## README

# node-expires

Simple Node.js expiration helper

## Install

```bash
$ npm install expires
```

## Usage

```javascript
var expires = require('expires');

// Returns some timestamp like 1341151672247
var timestamp = expires.after('2 seconds');

// Then it can be tested for expiration
expires.expired(timestamp);  // false
setTimeout(function() {
	expires.expired(timestamp);  // true
}, 2500);
```

### Supported Units

* "ms", "millisecond(s)"
* "sec(s)", "second(s)"
* "min(s)", "minute(s)"
* "hr(s)", "hour(s)"
* "day(s)"
* "wk(s)", "week(s)"
* "yr(s)", "year(s)"

### Fractions

Also completely valid are fractional values, such as the following:

```javascript
expires.after('0.5 hours');
expires.after('1/2 hours');

// A bit extreme, but still valid
expires.after('2.3/4.5 hours');
```

---
_Source: https://npm.io/package/expires · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
