# time-window

> A simple tool to determine if a particular time is within a window of time.

Latest version **0.1.0** (published 2017-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install time-window
pnpm add time-window
yarn add time-window
bun add time-window
```

## 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.1.0 |
| Published | 2017-11-27 |
| First published | 2017-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Naive Roboticist |
| Maintainers | naiveroboticist |
| Keywords | time, window |

## Links

- npm: https://www.npmjs.com/package/time-window
- npm.io page: https://npm.io/package/time-window

## Dependencies (2)

- [cron-converter](https://npm.io/package/cron-converter.md) 0.0.12
- [moment-timezone](https://npm.io/package/moment-timezone.md) ^0.5.14

## Recent versions

- 0.1.0 (latest) — 2017-11-27

## README

# time-window

A simple tool to determine if a particular time is within 
a window of time. Uses a cron specification to define the
time window.

## Install

    npm install time-window --save

## Use

This usage assumes you are using nodejs.

    const TimeWindow = require('time-window')

    // Assume time zone of America/Denver
    // The window is the 5PM hour on Thursday
    let timeWindow = new TimeWindow('* 17 * * 4')

    if (timeWindow.inTimeWindow()) {
      console.log('Current time is in window!!')
    }

    // Specify the time zone you want
    // The window is the 8-9PM hours on Thursday
    let timeWindow = new TimeWindow('* 20-21 * * 4', 'America/Chicago')
    if (timeWindow.inTimeWIndow()) {
      console.log('Current Chicago time is in window!!')
    }

# License

This project uses the MIT license.

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