# cut-file-stream

> cut file stream by time

Latest version **1.2.0** (published 2016-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cut-file-stream
pnpm add cut-file-stream
yarn add cut-file-stream
bun add cut-file-stream
```

## 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.2.0 |
| Published | 2016-02-15 |
| First published | 2015-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shuxiang |
| Maintainers | shuxiang |
| Keywords | file, stream, timezone, date, log, morgan |

## Links

- npm: https://www.npmjs.com/package/cut-file-stream
- Repository: https://github.com/zhaoshuxiang/cut-file-stream
- Homepage: https://github.com/zhaoshuxiang/cut-file-stream#readme
- Issues: https://github.com/zhaoshuxiang/cut-file-stream/issues
- npm.io page: https://npm.io/package/cut-file-stream

## 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.2.0 (latest) — 2016-02-15
- 1.1.8 — 2016-02-15
- 1.1.7 — 2015-08-05
- 1.1.6 — 2015-08-05
- 1.1.5 — 2015-07-31
- 1.1.4 — 2015-07-31
- 1.1.3 — 2015-07-17
- 1.1.2 — 2015-07-17
- 1.1.1 — 2015-07-16
- 1.1.0 — 2015-07-15
- 1.0.1 — 2015-07-09
- 1.0.0 — 2015-07-08

## README

# Cut Log File Stream

Support morgan  
Support timeZone  

## Install
```
npm install --save cut-file-stream
```

## Usage

Format filename：

- YYYY => Year
- MM => Month
- DD => Day
- H => Hour
- M => minute
- S => Second

Cut file stream by day
```js
var cts = require('cut-file-stream');
var stream = cfs.getStream({
    filename: 'custom-string-YYYYMMDD-custom-string.log',
    timeZone: 0 // UTC
});
```

Cut file stream by hour
```js
var cts = require('cut-file-stream');
var stream = cfs.getStream({
    filename: 'custom-string-YYYYMMDDH-custom-string.log',
});
```

Cut file stream by minute
```js
var cts = require('cut-file-stream');
var stream = cfs.getStream({
    filename: 'custom-string-YYYYMMDDHM-custom-string.log'
});
```

Get format datetime
```js
var cts = require('cut-file-stream');
var stream = cts.getDateTime('YYYYMMDDHM');
// return 201507311230
```

If no filename, stdout will return

If no timeZone, default timeZone will be BeiJing: UTC+8

## Bug fixed list
2015/07/31  Export method getDateTime
2015/07/16  Support multi log file steam 

## Contact

If you have any question, please contact me zhaoshuxiang2010@gmail.com

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