appendFile
Description
Appends an input Observable's content to a local file (using fs.appendFile).
Examples
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.
Returns
None
Arguments
None
Options
None
Last updated
Was this helpful?