Socket
Socket
Sign inDemoInstall

read-chunk

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-chunk - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

45

index.d.ts
/// <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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc