# appendFile

## Description

Appends an input Observable's content to a local file (using [fs.appendFile](https://nodejs.org/api/fs.html#fs_fs_appendfile)).

## Examples

```javascript
import path from 'path';
import {of} from 'rxjs';
import {appendFile} from 'rxfs';

const data = [
  '"animal","coolness"',
  '"dolphin",10',
  '"algea",1',
  '"mermaid",6',
  '"octopus",9',
  '"octopus",9',
  '"narwhale",8',
];

const writeStream$ = of(...data).pipe(
  appendFile({filePath: path.resolve(__dirname, './output.csv')})
);
// write the input observable to the file
writeStream$.subscribe(console.log);
```

## API

```
writeFile({
  filePath<String>,
  [options={}]
})
```

### Since

0.1

### Parameters

* `filePath`: Path to the file.

### Options

* `options<Object>`: Options to pass into [fs.appendFile](https://nodejs.org/api/fs.html#fs_fs_appendfile).

### Returns

None

### Arguments

None

### Options

None


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://brianbuccaneer.gitbook.io/bottlenose/v0.7.0/sources-and-sinks/rxfs/operators/appendfile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
