@@ -369,16 +369,20 @@ added: v10.0.0
369
369
370
370
<!-- YAML
371
371
added: v10.0.0
372
+ changes:
373
+ - version: REPLACEME
374
+ pr-url: https://github.com/nodejs/node/pull/42835
375
+ description: Accepts bigint values as ` position` .
372
376
-->
373
377
374
378
* ` buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the
375
379
file data read.
376
380
* ` offset` {integer} The location in the buffer at which to start filling.
377
381
* ` length` {integer} The number of bytes to read.
378
- * ` position` {integer|null} The location where to begin reading data from the
379
- file. If ` null ` , data will be read from the current file position, and
380
- the position will be updated. If ` position` is an integer, the current
381
- file position will remain unchanged.
382
+ * ` position` {integer|bigint| null} The location where to begin reading data
383
+ from the file. If ` null ` or ` - 1 ` , data will be read from the current file
384
+ position, and the position will be updated. If ` position` is a non-negative
385
+ integer, the current file position will remain unchanged.
382
386
* Returns: {Promise} Fulfills upon success with an object with two properties:
383
387
* ` bytesRead` {integer} The number of bytes read
384
388
* ` buffer` {Buffer|TypedArray|DataView} A reference to the passed in ` buffer`
@@ -395,6 +399,10 @@ number of bytes read is zero.
395
399
added:
396
400
- v13.11.0
397
401
- v12.17.0
402
+ changes:
403
+ - version: REPLACEME
404
+ pr-url: https://github.com/nodejs/node/pull/42835
405
+ description: Accepts bigint values as ` position` .
398
406
-->
399
407
400
408
* ` options` {Object}
@@ -404,10 +412,11 @@ added:
404
412
**Default:** ` 0 `
405
413
* ` length` {integer} The number of bytes to read. **Default:**
406
414
` buffer .byteLength - offset`
407
- * ` position` {integer|null} The location where to begin reading data from the
408
- file. If ` null ` , data will be read from the current file position, and
409
- the position will be updated. If ` position` is an integer, the current
410
- file position will remain unchanged. **Default:**: ` null `
415
+ * ` position` {integer|bigint|null} The location where to begin reading data
416
+ from the file. If ` null ` or ` - 1 ` , data will be read from the current file
417
+ position, and the position will be updated. If ` position` is a non-negative
418
+ integer, the current file position will remain unchanged.
419
+ **Default:**: ` null `
411
420
* Returns: {Promise} Fulfills upon success with an object with two properties:
412
421
* ` bytesRead` {integer} The number of bytes read
413
422
* ` buffer` {Buffer|TypedArray|DataView} A reference to the passed in ` buffer`
@@ -424,6 +433,10 @@ number of bytes read is zero.
424
433
added:
425
434
- v18.2.0
426
435
- v16.17.0
436
+ changes:
437
+ - version: REPLACEME
438
+ pr-url: https://github.com/nodejs/node/pull/42835
439
+ description: Accepts bigint values as ` position` .
427
440
-->
428
441
429
442
* ` buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the
@@ -433,10 +446,11 @@ added:
433
446
**Default:** ` 0 `
434
447
* ` length` {integer} The number of bytes to read. **Default:**
435
448
` buffer .byteLength - offset`
436
- * ` position` {integer} The location where to begin reading data from the
437
- file. If ` null ` , data will be read from the current file position, and
438
- the position will be updated. If ` position` is an integer, the current
439
- file position will remain unchanged. **Default:**: ` null `
449
+ * ` position` {integer|bigint|null} The location where to begin reading data
450
+ from the file. If ` null ` or ` - 1 ` , data will be read from the current file
451
+ position, and the position will be updated. If ` position` is a non-negative
452
+ integer, the current file position will remain unchanged.
453
+ **Default:**: ` null `
440
454
* Returns: {Promise} Fulfills upon success with an object with two properties:
441
455
* ` bytesRead` {integer} The number of bytes read
442
456
* ` buffer` {Buffer|TypedArray|DataView} A reference to the passed in ` buffer`
@@ -3514,8 +3528,8 @@ changes:
3514
3528
* ` length` {integer} The number of bytes to read.
3515
3529
* ` position` {integer|bigint|null} Specifies where to begin reading from in the
3516
3530
file. If ` position` is ` null ` or ` - 1 ` , data will be read from the current
3517
- file position, and the file position will be updated. If ` position` is an
3518
- integer, the file position will be unchanged.
3531
+ file position, and the file position will be updated. If ` position` is
3532
+ a non-negative integer, the file position will be unchanged.
3519
3533
* ` callback` {Function}
3520
3534
* ` err` {Error}
3521
3535
* ` bytesRead` {integer}
0 commit comments