Socket
Socket
Sign inDemoInstall

file-timestamp-stream

Package Overview
Dependencies
1
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    file-timestamp-stream

Writing stream with file rotating based on timestamp


Version published
Weekly downloads
174
increased by37.01%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

v0.0.2 2017-02-17

  • Minor optimizations and better error handling
  • BDD tests
  • Relicensed to MIT

Readme

Source

file-timestamp-stream

Build Status Coverage Status npm

This module creates stream.Writable to a file which is automatically rotated based on current time.

Installation

npm install file-timestamp-stream

Usage

const FileTimestampStream = require('file-timestamp-stream')

const stream = new FileTimestampStream({
  path: '%Y-%m-%dT%H.log',
  flags: 'a'
})
Options:
  • newFilename is a custom function which returns new filename (default: returns new filename based on path and current time)
  • flags is a string with flags for opened stream (default: 'a')
  • fs is a custom fs module (optional)
  • path is a template for new filenames (default: 'out.log')
Properties:
  • currentFilename contains last opened filename
  • wstream contains fs.WriteStream object
Path template format:

Path can contain strftime specifiers.

License

Copyright (c) 2017 Piotr Roszatycki piotr.roszatycki@gmail.com

MIT

Keywords

FAQs

Last updated on 17 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc