# simple-opening-hours

> Simple parser for OpenStreetMap opening_hours

Latest version **0.1.1** (published 2019-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-opening-hours
pnpm add simple-opening-hours
yarn add simple-opening-hours
bun add simple-opening-hours
```

## 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.1 |
| Published | 2019-03-21 |
| First published | 2019-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | webk1d |
| Maintainers | webk1d |
| Keywords | opening_hours, osm, openstreetmap |

## Links

- npm: https://www.npmjs.com/package/simple-opening-hours
- Repository: https://github.com/wbkd/simple-opening-hours
- Homepage: https://github.com/wbkd/simple-opening-hours#readme
- Issues: https://github.com/wbkd/simple-opening-hours/issues
- npm.io page: https://npm.io/package/simple-opening-hours

## Recent versions

- 0.1.1 (latest) — 2019-03-21
- 0.1.0 — 2019-03-21
- 0.0.1 — 2019-03-21

## README

# SimpleOpeningHours()

SimpleOpeningHours is a small JavaScript class to parse OpenStreetMap `opening_hours`.
It only supports the human readable parts and not [this complete crazy overengineered specification](https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification).

## Supported opening_hours examples

* `Mo-Sa 06:00-22:00`
* `Mo-Fr 08:00-18:00; Sa 10:00-14:00`
* `Mo-Fr 08:00-18:00; Sa,Su 10:00-20:00`
* `Mo-Fr 08:00-12:00, We 14:00-18:00`
* `Mo-Fr 08:00-12:00, 14:00-18:00`
* `Mo-Fr 08:00-18:00; We off`
* `24/7`

## Usage
```javascript
var opening = new SimpleOpeningHours('Mo-Sa 06:00-22:00');
console.log('Is this open now?', opening.isOpenNow());
console.log('Is this open on 2016-10-01 18:00?', opening.isOpenOn(new Date('2016-10-01 18:00')));
console.table(opening.getTable());
```

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