diff --git a/doc/api/fs.md b/doc/api/fs.md index 9e3b0df9a487b9..19c22e127dd0eb 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1569,6 +1569,16 @@ should be passed to [`net.Socket`][]. If `options` is a string, then it specifies the encoding. +```js +// Create a stream of file copy functions +const fs = require('fs'); + +const rs = fs.createReadStream('./out.txt'); +const ws = fs.createWriteStream('./input.txt', { flags: 'a' }); + +rs.pipe(ws); // Out.txt content pipe to input.txt +``` + ## fs.exists(path, callback)