daily-rotating-file-stream
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -40,2 +40,6 @@ 'use strict' | ||
flush () { | ||
this[stream].flush() | ||
} | ||
destroy () { | ||
@@ -42,0 +46,0 @@ this[stream].destroy() |
{ | ||
"name": "daily-rotating-file-stream", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "file stream being rotating daily", | ||
@@ -5,0 +5,0 @@ "main": "lib/DailyRotatingFileStream.js", |
@@ -5,3 +5,3 @@ # daily-rotating-file-stream | ||
[![Coverage Status](https://coveralls.io/repos/github/SerayaEryn/daily-rotating-file-stream/badge.svg?branch=master)](https://coveralls.io/github/SerayaEryn/daily-rotating-file-stream?branch=master) | ||
[![NPM version](https://img.shields.io/npm/v/daily-rotating-file-stream.svg?style=flat)](https://www.npmjs.com/package/daily-rotating-file-stream) [![Greenkeeper badge](https://badges.greenkeeper.io/SerayaEryn/daily-rotating-file-stream.svg)](https://greenkeeper.io/) | ||
[![NPM version](https://img.shields.io/npm/v/daily-rotating-file-stream.svg?style=flat)](https://www.npmjs.com/package/daily-rotating-file-stream) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
@@ -36,2 +36,6 @@ | ||
## DailyRotatingFileStream#flush() | ||
Flushes the content of the buffer to the file. | ||
## DailyRotatingFileStream#destroy() | ||
@@ -38,0 +42,0 @@ |
@@ -139,2 +139,22 @@ 'use strict' | ||
test('Should flush', (t) => { | ||
t.plan(2) | ||
const options = { | ||
fileName: join(__dirname, '/testfiles5/console%DATE%.log') | ||
} | ||
const fileName = getFileName(5) | ||
const stream = new DailyRotatingFileStream(options) | ||
stream.write('hello world') | ||
stream.flush() | ||
stream.on('finish', () => { | ||
fs.readFile(fileName, (err, buffer) => { | ||
t.error(err) | ||
t.strictEquals(buffer.toString(), 'hello world') | ||
cleanUp(fileName) | ||
}) | ||
}) | ||
stream.end() | ||
}) | ||
function cleanUp (fileName) { | ||
@@ -141,0 +161,0 @@ if (fs.existsSync(fileName)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10074
220
50