fs.write

fs.write

fs.write

Function

Overwrite the contents of the written file.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
contentAnyNo''Content to write; arrays and objects write JSON strings.

Return value

TypeDescription
IntReturns the number of bytes written.

Example

Notes

  • Existing file contents will be overwritten.
  • When the parent directory does not exist, the underlying file writing rules determine whether to report an error.