truncate

The truncate() method of the FileSystemWritableFileStream interface resizes the file associated with the stream to the specified size in bytes.

MDN Reference