read-chunk
Advanced tools
Comparing version 3.1.0 to 3.2.0
/// <reference types="node"/> | ||
/** | ||
* Read a chunk from a file asyncronously. | ||
* | ||
* @param filePath - The path to the file. | ||
* @param startPosition - Position to start reading. | ||
* @param length - Number of bytes to read. | ||
* @returns The read chunk. | ||
*/ | ||
declare const readChunk: { | ||
/** | ||
Read a chunk from a file asyncronously. | ||
@param filePath - The path to the file. | ||
@param startPosition - Position to start reading. | ||
@param length - Number of bytes to read. | ||
@returns The read chunk. | ||
@example | ||
``` | ||
import readChunk = require('read-chunk'); | ||
// foo.txt => hello | ||
readChunk.sync('foo.txt', 1, 3); | ||
//=> 'ell' | ||
``` | ||
*/ | ||
(filePath: string, startPosition: number, length: number): Promise<Buffer>; | ||
/** | ||
* Read a chunk from a file synchronously. | ||
* | ||
* @param filePath - The path to the file. | ||
* @param startPosition - Position to start reading. | ||
* @param length - Number of bytes to read. | ||
* @returns The read chunk. | ||
*/ | ||
Read a chunk from a file synchronously. | ||
@param filePath - The path to the file. | ||
@param startPosition - Position to start reading. | ||
@param length - Number of bytes to read. | ||
@returns The read chunk. | ||
*/ | ||
sync(filePath: string, startPosition: number, length: number): Buffer; | ||
// TODO: Remove this for the next major release | ||
default: typeof readChunk; | ||
}; | ||
export default readChunk; | ||
export = readChunk; |
@@ -24,2 +24,3 @@ 'use strict'; | ||
module.exports = readChunk; | ||
// TODO: Remove this for the next major release | ||
module.exports.default = readChunk; | ||
@@ -26,0 +27,0 @@ |
{ | ||
"name": "read-chunk", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Read a chunk from a file", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -39,11 +39,11 @@ "files": [ | ||
"pify": "^4.0.1", | ||
"with-open-file": "^0.1.5" | ||
"with-open-file": "^0.1.6" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^11.10.4", | ||
"ava": "^1.3.1", | ||
"sinon": "^7.2.7", | ||
"tsd-check": "^0.3.0", | ||
"@types/node": "^11.12.2", | ||
"ava": "^1.4.1", | ||
"sinon": "^7.3.1", | ||
"tsd": "^0.7.1", | ||
"xo": "^0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4490
59
Updatedwith-open-file@^0.1.6