Skip to content

Commit

Permalink
feat: return stream for module usage
Browse files Browse the repository at this point in the history
  • Loading branch information
thelicato committed May 17, 2023
1 parent 59ab9d0 commit a9f15b5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { createStream, Options } from 'rotating-file-stream';

export interface IPinoRotatingFileStreamOptions extends Options {
filename: string;
path: string;
}

export default (options: IPinoRotatingFileStreamOptions) => {
const { filename, size, maxSize, interval, compress, path } = options;
return createStream(filename, {
size: size || '100M',
maxSize: maxSize || '1G',
interval: interval || '7d',
compress: compress || 'gzip',
path: path,
});
};

0 comments on commit a9f15b5

Please sign in to comment.