Skip to content

Commit 6c5acd6

Browse files
committed
Newer stream.finished with Typescript support is used
1 parent 03c25d7 commit 6c5acd6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ Protected properties for custom subclass:
120120

121121
Path can contain [strftime](https://www.npmjs.com/package/strftime) specifiers.
122122

123+
### Warning
124+
125+
This stream have to be closed to free own streams and timers.
126+
123127
## License
124128

125129
Copyright (c) 2017-2018 Piotr Roszatycki <[email protected]>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"node": ">=6.0.0"
2424
},
2525
"dependencies": {
26-
"stream.finished": "^1.0.1",
26+
"stream.finished": "^1.1.0",
2727
"tslib": "^1.9.3",
2828
"ultra-strftime": "^1.0.2"
2929
},
3030
"devDependencies": {
3131
"@types/chai": "^4.1.4",
3232
"@types/mocha": "^5.2.5",
33-
"@types/node": "^10.10.0",
33+
"@types/node": "^10.10.1",
3434
"@types/ultra-strftime": "^1.0.0",
3535
"chai": "^4.1.2",
3636
"coveralls": "^3.0.2",

src/file-timestamp-stream.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
import fs, { WriteStream } from 'fs'
44
import { Writable, WritableOptions } from 'stream'
5+
import finished from 'stream.finished'
56
import strftime from 'ultra-strftime'
67

7-
// tslint:disable-next-line:no-var-requires
8-
const finished = require('stream.finished') as (stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback?: (err: NodeJS.ErrnoException) => void) => () => void // TODO: wait for new typings for node
9-
108
export interface FileTimestampStreamOptions extends WritableOptions {
119
/** a string with [flags](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback) for opened stream (default: `'a'`) */
1210
flags?: string | null

0 commit comments

Comments
 (0)