> For the complete documentation index, see [llms.txt](https://brianbuccaneer.gitbook.io/bottlenose/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brianbuccaneer.gitbook.io/bottlenose/dev-2/sources-and-sinks/rxfs/operators/writefile.md).

# writeFile

## Description

Write's an input Observable's content to the local filesystem (using [fs.createWriteStream](https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options)) and converts its content to an RxJS stream.

## Examples

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

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

const writeStream$ = of(...data).pipe(
  writeFile({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.createWriteStream](https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options).

### Returns

None

### Arguments

None

### Options

None
