peek-readable
Advanced tools
Comparing version 5.0.0-alpha.5 to 5.0.0
@@ -0,0 +0,0 @@ export declare class Deferred<T> { |
@@ -0,0 +0,0 @@ export class Deferred { |
@@ -0,0 +0,0 @@ export declare const defaultMessages = "End-Of-Stream"; |
@@ -0,0 +0,0 @@ export const defaultMessages = 'End-Of-Stream'; |
export { EndOfStreamError } from './EndOfFileStream.js'; | ||
export { StreamReader } from './StreamReader.js'; |
export { EndOfStreamError } from './EndOfFileStream.js'; | ||
export { StreamReader } from './StreamReader.js'; |
@@ -1,2 +0,2 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { Readable } from 'node:stream'; | ||
@@ -40,3 +40,3 @@ export { EndOfStreamError } from './EndOfFileStream.js'; | ||
*/ | ||
private _read; | ||
private readFromStream; | ||
/** | ||
@@ -43,0 +43,0 @@ * Process deferred read request |
@@ -70,3 +70,3 @@ import { EndOfStreamError } from './EndOfFileStream.js'; | ||
const reqLen = Math.min(remaining, maxStreamReadSize); | ||
const chunkLen = await this._read(buffer, offset + bytesRead, reqLen); | ||
const chunkLen = await this.readFromStream(buffer, offset + bytesRead, reqLen); | ||
bytesRead += chunkLen; | ||
@@ -86,3 +86,3 @@ if (chunkLen < reqLen) | ||
*/ | ||
async _read(buffer, offset, length) { | ||
async readFromStream(buffer, offset, length) { | ||
const readBuffer = this.s.read(length); | ||
@@ -89,0 +89,0 @@ if (readBuffer) { |
{ | ||
"name": "peek-readable", | ||
"version": "5.0.0-alpha.5", | ||
"version": "5.0.0", | ||
"description": "Read and peek from a readable stream", | ||
@@ -24,7 +24,6 @@ "author": { | ||
"test-coverage": "c8 npm run test", | ||
"send-coveralls": "c8 report --reporter=text-lcov | coveralls", | ||
"start": "npm run compile && npm run lint && npm run cover-test" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"node": ">=14.16" | ||
}, | ||
@@ -47,18 +46,23 @@ "repository": { | ||
"devDependencies": { | ||
"@types/chai": "^4.3.0", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^17.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.31.0", | ||
"@typescript-eslint/parser": "^4.31.0", | ||
"add": "^2.0.6", | ||
"c8": "^7.8.0", | ||
"chai": "^4.3.4", | ||
"@types/chai": "^4.3.1", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^18.6.3", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"c8": "^7.12.0", | ||
"chai": "^4.3.6", | ||
"coveralls": "^3.1.1", | ||
"del-cli": "^4.0.1", | ||
"del-cli": "^5.0.0", | ||
"eslint": "^7.32.0", | ||
"mocha": "^9.1.3", | ||
"remark-cli": "^10.0.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-import-resolver-typescript": "^3.4.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsdoc": "^39.3.4", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-unicorn": "^40.1.0", | ||
"mocha": "^10.0.0", | ||
"remark-cli": "^11.0.0", | ||
"remark-preset-lint-recommended": "^6.1.2", | ||
"ts-node": "^10.1.0", | ||
"typescript": "^4.4.2" | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.7.4" | ||
}, | ||
@@ -65,0 +69,0 @@ "keywords": [ |
@@ -30,3 +30,5 @@ ![Node.js CI](https://github.com/Borewit/peek-readable/workflows/Node.js%20CI/badge.svg) | ||
NPM module is compliant with [ECMAScript 2017 (ES8)](https://en.wikipedia.org/wiki/ECMAScript#8th_Edition_-_ECMAScript_2017). | ||
Module: version 5 migrated from [CommonJS](https://en.wikipedia.org/wiki/CommonJS) to [pure ECMAScript Module (ESM)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). | ||
JavaScript is compliant with [ECMAScript 2019 (ES10)](https://en.wikipedia.org/wiki/ECMAScript#10th_Edition_%E2%80%93_ECMAScript_2019). | ||
Requires Node.js ≥ 14.16 engine. | ||
@@ -39,4 +41,4 @@ ## Examples | ||
```js | ||
const fs = require('fs'); | ||
const { StreamReader } = require('peek-readable'); | ||
import fs from 'node:fs'; | ||
import { StreamReader } from 'peek-readable'; | ||
@@ -73,4 +75,4 @@ (async () => { | ||
```js | ||
const fs = require('fs'); | ||
const { StreamReader } = require('peek-readable'); | ||
import fs from 'node:fs'; | ||
import { StreamReader } from 'peek-readable'; | ||
@@ -77,0 +79,0 @@ const fileReadStream = fs.createReadStream('JPEG_example_JPG_RIP_001.jpg'); |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14613
1
96
0
21