Socket
Book a DemoInstallSign in
Socket

growing-file

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

growing-file

A readable file stream for files that are growing.

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
1.1K
23.76%
Maintainers
0
Weekly downloads
 
Created
Source

node-growing-file

Purpose

Sometimes you need to read from a file that is still being written to by another process. This library provides a readable stream that keeps reading until the file has been idle for a certain time.

Current status

This module is still fresh. Try it while it's hot.

Installation

npm install growing-file

Usage

var file = GrowingFile.open('my-growing-file.dat');
file.pipe(<some writeable stream>);

Note: The file does not have to exist yet when invoking this method. An 'error' event is emitted if it is not created within the configured timeout.

Options

GrowingFile.create accepts an options array.

var file = GrowingFile.open(path, options);

Where options defaults to:

{
  timeout: 3000,
  interval: 100,
}

Time values are given in ms.

  • timeout determines after what time a file is considered to be done growing.
  • interval specifies the frequency at which the file is being polled for changes.

License

Written by Felix Geisendörfer, licensed under the MIT license.

FAQs

Package last updated on 04 Jul 2011

Did you know?

Socket

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