# @twilson63/compact

> A document removal and compact routine

Latest version **1.0.2** (published 2016-01-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @twilson63/compact
pnpm add @twilson63/compact
yarn add @twilson63/compact
bun add @twilson63/compact
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-01-22 |
| First published | 2015-05-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom |
| Maintainers | twilson63 |

## Links

- npm: https://www.npmjs.com/package/@twilson63/compact
- npm.io page: https://npm.io/package/@twilson63/compact

## Dependencies (3)

- [nano](https://npm.io/package/nano.md) ^6.1.2
- [ramda](https://npm.io/package/ramda.md) ^0.14.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.25

## Recent versions

- 1.0.2 (latest) — 2016-01-22
- 1.0.1 — 2015-05-14
- 1.0.0 — 2015-05-14

## README

# twilson63/compact

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

This is a specialized function that creates a view that looks for an attr on each document called `expires_in` - this attribute is a ISO String of a datetime.  This view compares the expires in date to the current date and 
determines if the document is expired.  If the document is expired it shows in the view and the value object represents the deleted document for the given document.  When the returned method is executed it will run the view and perform a bulk delete on all documents that match the expired criteria.  Then it will perform a full compact on the database.  The main purpose of this module is to enable a time to live feature for a queue system called `cloudq` - this time to live feature enables the documents to be processed for a certain period in time then they are removed.

## usage

``` js
var c = require('@twilson63/compact')(<couchdb database url>)

c().then(success, failure)
```

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