# log-rotate

> Rotate log files with ease

Latest version **0.2.8** (published 2018-04-20) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install log-rotate
pnpm add log-rotate
yarn add log-rotate
bun add log-rotate
```

Provides the command `log-rotate`.

## Health

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

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

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.8 |
| Published | 2018-04-20 |
| First published | 2013-11-10 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | separate (@types/log-rotate) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Drew Stokes |
| Maintainers | dstokes |
| Keywords | log, rotate |

## Links

- npm: https://www.npmjs.com/package/log-rotate
- Repository: https://github.com/dstokes/log-rotate
- Homepage: https://github.com/dstokes/log-rotate#readme
- Issues: https://github.com/dstokes/log-rotate/issues
- npm.io page: https://npm.io/package/log-rotate

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.2.8 (latest) — 2018-04-20
- 0.2.7 — 2014-04-01
- 0.2.6 — 2014-02-21
- 0.2.5 — 2014-01-29
- 0.2.4 — 2013-11-19
- 0.2.3 — 2013-11-19
- 0.2.2 — 2013-11-13
- 0.2.1 — 2013-11-11
- 0.2.0 — 2013-11-11
- 0.1.0 — 2013-11-11
- 0.0.1 — 2013-11-10

## README

log-rotate
======

Rotate a log similar to the way linux logrotate does, appending and updating
`.NUM` indexes as you go.

[![Build Status](https://travis-ci.org/dstokes/log-rotate.png)](https://travis-ci.org/dstokes/log-rotate)  
[![NPM](https://nodei.co/npm/log-rotate.png?downloads=true)](https://nodei.co/npm/log-rotate/)  

Example
=======
``` js
var rotate = require('log-rotate');
  
// move a log file while incrementing existing indexed / rotated logs
rotate('./test.log', function(err) {
  // ls ./ => test.log test.log.0
});
```

options
=======

### count
Limit the number of rotated files to `count`

``` js
var rotate = require('log-rotate');

rotate('./test.log', { count: 3 }, function(err) {
  // ls ./ => test.log test.log.0 test.log.1
});
```

### compress
Compress rotated files with gzip

install
=======

With [npm](http://npmjs.org) do:

```
npm install log-rotate
```

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