# time-gaps

> A simple module for working with time intervals ## Installation ```bash $ npm install time-gaps ``` ## Usage ```javascript const timeGaps = require('time-gaps'); ``` ## Example ```javascript const timeGaps = require('time-gaps');

Latest version **1.1.7** (published 2024-04-06) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.7 |
| Published | 2024-04-06 |
| First published | 2018-02-18 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 6.11.5 |
| Dependencies | 2 |
| Unpacked size | 39.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vasiliy Kryuchkov |
| Maintainers | vkryuchkov |
| Keywords | time, gaps, interval, merge |

## Links

- npm: https://www.npmjs.com/package/time-gaps
- Repository: https://github.com/v-kryuchkov/time-gaps
- Homepage: https://github.com/v-kryuchkov/time-gaps#readme
- Issues: https://github.com/v-kryuchkov/time-gaps/issues
- npm.io page: https://npm.io/package/time-gaps

## Dependencies (2)

- [luxon](https://npm.io/package/luxon.md) ^3.4.4
- [ramda](https://npm.io/package/ramda.md) ^0.29.1

## 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

- 1.1.7 (latest) — 2024-04-06
- 1.1.6 — 2022-05-09
- 1.1.5 — 2022-05-09
- 1.1.4 — 2019-06-27
- 1.1.3 — 2019-05-23
- 1.1.2 — 2019-03-12
- 1.1.1 — 2018-03-28
- 1.1.0 — 2018-03-27
- 1.0.0 — 2018-02-18

## README

# time-gaps
A simple module for working with time intervals
## Installation
```bash
$ npm install time-gaps
```
## Usage
```javascript
const timeGaps = require('time-gaps');
```
## Example
```javascript
const timeGaps = require('time-gaps');

// previously available intervals
const oldIntervals = [{
  from: '2015-08-03T13:00:00.000Z',
  to: '2015-08-03T13:30:00.000Z',
}, {
  from: '2015-08-03T14:00:00.000Z',
  to: '2015-08-03T14:30:00.000Z',
}];

const newIntervals = [{
  from: '2015-08-03T12:45:00.000Z',
  to: '2015-08-03T13:15:00.000Z',
}];

const mergedIntervals = timeGaps.megre(newIntervals, oldIntervals);
/*
[
  {
    from: '2015-08-03T12:45:00.000Z',
    to: '2015-08-03T13:00:00.000Z',
  },
  {
    from: '2015-08-03T13:00:00.000Z',
    to: '2015-08-03T13:30:00.000Z',
  },
  {
    from: '2015-08-03T14:00:00.000Z',
    to: '2015-08-03T14:30:00.000Z',
  },
] */
```

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