Comparing version 4.0.3 to 4.1.0
13
index.js
@@ -11,3 +11,4 @@ 'use strict' | ||
const Stream = require('stream') | ||
const SD = require('string_decoder').StringDecoder | ||
const stringdecoder = require('string_decoder') | ||
const SD = stringdecoder.StringDecoder | ||
@@ -97,3 +98,3 @@ const EOF = Symbol('EOF') | ||
module.exports = class Minipass extends Stream { | ||
class Minipass extends Stream { | ||
constructor(options) { | ||
@@ -664,6 +665,10 @@ super() | ||
(s instanceof EE && | ||
(typeof s.pipe === 'function' || // readable | ||
(typeof s.write === 'function' && typeof s.end === 'function')))) // writable | ||
// readable | ||
(typeof s.pipe === 'function' || | ||
// writable | ||
(typeof s.write === 'function' && typeof s.end === 'function')))) | ||
) | ||
} | ||
} | ||
module.exports = Minipass |
{ | ||
"name": "minipass", | ||
"version": "4.0.3", | ||
"version": "4.1.0", | ||
"description": "minimal implementation of a PassThrough stream", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"main": "./index.js", | ||
"module": "./index.mjs", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./index.d.ts", | ||
"default": "./index.mjs" | ||
}, | ||
"require": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"devDependencies": { | ||
@@ -18,2 +32,6 @@ "@types/node": "^17.0.41", | ||
"scripts": { | ||
"pretest": "npm run prepare", | ||
"presnap": "npm run prepare", | ||
"prepare": "node ./scripts/transpile-to-esm.mjs", | ||
"snap": "tap", | ||
"test": "tap", | ||
@@ -38,3 +56,4 @@ "preversion": "npm test", | ||
"index.d.ts", | ||
"index.js" | ||
"index.js", | ||
"index.mjs" | ||
], | ||
@@ -41,0 +60,0 @@ "tap": { |
@@ -89,3 +89,7 @@ # minipass | ||
```js | ||
// hybrid module, either works | ||
import Minipass from 'minipass' | ||
// or: | ||
const Minipass = require('minipass') | ||
const stream = new Minipass() | ||
@@ -110,3 +114,7 @@ stream.on('data', () => console.log('data event')) | ||
```js | ||
// hybrid module, either works | ||
import Minipass from 'minipass' | ||
// or: | ||
const Minipass = require('minipass') | ||
const asyncStream = new Minipass({ async: true }) | ||
@@ -127,3 +135,3 @@ asyncStream.on('data', () => console.log('data event')) | ||
```js | ||
const Minipass = require('minipass') | ||
import Minipass from 'minipass' | ||
const stream = new Minipass({ encoding: 'utf8' }) | ||
@@ -371,3 +379,3 @@ stream.on('data', chunk => console.log(chunk)) | ||
```js | ||
const Minipass = require('minipass') | ||
import Minipass from 'minipass' | ||
const mp = new Minipass(options) // optional: { encoding, objectMode } | ||
@@ -374,0 +382,0 @@ mp.write('foo') |
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
67225
6
1280
741