good-file

Basic write stream that ensures destination exists before opening for writing.

BSD-3-Clause 16 个版本
安装
npm install good-file
yarn add good-file
pnpm add good-file
bun add good-file
README

good-file

Simple Node write stream to write to a file.

Build StatusCurrent Version

Lead Maintainer: Adam Bretz

Good File

This is a basic write stream wrapper of Node core Fs.createWriteStream(). The advantage is GoodFile will create the file and directory if they do not already exist.

new GoodFile (path, options)

Creates a new GoodFile write stream.

  • path a string for the file to write to. Will be created only if needed.
  • [options] optional file stream options. Defaults to { encoding: 'utf8', flags: 'a', mode: 0o666 }. fd will always default to -1 during object construction. For more information about options, refer to the Node documentation

Rotation

If you're looking for a stream with built-in rotation options, please check out stream-rotate or rotating-file-stream. good-file no longer does file rotation because there are better ways to deal with log rotation at the operating system level.

版本列表
6.0.1 2016-05-02
6.0.0 2016-04-12
5.1.3 2016-04-21
5.1.2 2016-02-05
5.1.1 2015-11-25
5.1.0 2015-09-24
5.0.1 2015-05-28
5.0.0 2015-04-07
4.0.2 2015-01-26
4.0.1 2014-11-28
4.0.0 2014-11-24
3.1.0 2014-11-06
3.0.0 2014-11-04
2.0.0 2014-10-06
1.0.0 2014-09-23
0.0.1 2014-09-12