write(options) {
        return __awaiter(this, void 0, void 0, function* () {
            const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
            const filePath = yield this.filePath();
            const writeFunc = overwrite ? writeFile : appendFile;
            yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
            return this.emptyBuffer();
        });
    }
Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.

@param {SummaryWriteOptions} [options] (optional) options for write operation

@returns {Promise<Summary>} summary instance