diff options
author | LinuxWizard42 <computerwizard@linuxmail.org> | 2022-10-12 23:08:57 +0300 |
---|---|---|
committer | LinuxWizard42 <computerwizard@linuxmail.org> | 2022-10-12 23:08:57 +0300 |
commit | 726b81b19251674e149ccfbb1abacbd837fc6db0 (patch) | |
tree | fbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/fs-extra/docs/fs-read-write.md | |
parent | 34f0890e175698940d49238097579f44e4d78c89 (diff) | |
download | FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst |
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/fs-extra/docs/fs-read-write.md')
-rw-r--r-- | node_modules/fs-extra/docs/fs-read-write.md | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/node_modules/fs-extra/docs/fs-read-write.md b/node_modules/fs-extra/docs/fs-read-write.md deleted file mode 100644 index 805ea3c..0000000 --- a/node_modules/fs-extra/docs/fs-read-write.md +++ /dev/null @@ -1,39 +0,0 @@ -# About `fs.read()` & `fs.write()` - -[`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback) & [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments. - -If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does. - -Here's the example promise usage: - -## `fs.read()` - -```js -// Basic promises -fs.read(fd, buffer, offset, length, position) - .then(results => { - console.log(results) - // { bytesRead: 20, buffer: <Buffer 0f 34 5d ...> } - }) - -// Async/await usage: -async function example () { - const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) -} -``` - -## `fs.write()` - -```js -// Basic promises -fs.write(fd, buffer, offset, length, position) - .then(results => { - console.log(results) - // { bytesWritten: 20, buffer: <Buffer 0f 34 5d ...> } - }) - -// Async/await usage: -async function example () { - const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) -} -``` |