https://github.com/salakjs/salak-file-stream-rotator
File stream rotator for SalakJS Log.
https://github.com/salakjs/salak-file-stream-rotator
Last synced: 2 months ago
JSON representation
File stream rotator for SalakJS Log.
- Host: GitHub
- URL: https://github.com/salakjs/salak-file-stream-rotator
- Owner: SalakJS
- License: mit
- Created: 2018-04-22T15:41:08.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-27T08:43:58.000Z (about 8 years ago)
- Last Synced: 2025-01-19T21:15:01.983Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# salak-file-stream-rotater
[![NPM version][npm-image]][npm-url]
[![David deps][david-image]][david-url]
[![NPM download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/salak-file-stream-rotator.svg?style=flat-square
[npm-url]: https://npmjs.org/package/salak-file-stream-rotator
[david-image]: https://img.shields.io/david/SalakJS/salak-file-stream-rotator.svg?style=flat-square
[david-url]: https://david-dm.org/SalakJS/salak-file-stream-rotator
[download-image]: https://img.shields.io/npm/dm/salak-file-stream-rotator.svg?style=flat-square
[download-url]: https://npmjs.org/package/salak-file-stream-rotator
Stream file rotator for SalakJS logs.
## Install
```sh
$ npm install --save salak-file-stream-rotator
```
## Usage
```javascript
const streamRotator = require('salak-file-stream-rotator')
streamRotator.write('hi, salak!')
```
## Options
- filename: absolute path
- date_format: defaults: YYYY-MM-DD
- size: max bytes which the file can store
- max_logs: how many files which can be keeped
- audit_file: which stored the files info, defaults: dir(filename) + '/.audit.json'
## License
MIT