Home > @rushstack/node-core-library > FileWriter > open

FileWriter.open() method

Opens a new file handle to the file at the specified path and given mode. Behind the scenes it uses fs.openSync(). The behaviour of this function is platform specific. See: https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_fs_open_path_flags_mode_callback

Signature:

static open(filePath: string, flags?: IFileWriterFlags): FileWriter;

Parameters

Parameter Type Description
filePath string The absolute or relative path to the file handle that should be opened.
flags IFileWriterFlags The flags for opening the handle

Returns:

FileWriter