Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

stream-match

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-match - npm Package Compare versions

Comparing version
1.2.1
to
2.0.0
+1
-5
index.js

@@ -1,4 +0,2 @@

'use strict'
const match = (stream, pattern) =>
export default (stream, pattern) =>
new Promise(resolve => {

@@ -20,3 +18,1 @@ const match =

})
module.exports = match
+3
-2
{
"name": "stream-match",
"version": "1.2.1",
"version": "2.0.0",
"license": "MIT",
"description": "Match a string in a stream. Zero dependencies",
"repository": "juliangruber/stream-match",
"type": "module",
"scripts": {

@@ -15,4 +16,4 @@ "release": "np",

"standard": "^14.3.1",
"tap": "^14.7.1"
"tap": "^15.0.9"
}
}

@@ -8,5 +8,10 @@ # stream-match

```js
import match from 'stream-match'
// Given a readable stream,
const res = await match(stream, /(p[^n]+n)/)
// `res` will containt `pattern` once it has been emitted.
// You can also wait for a string to be emitted, for example:
await match(ps.stdout, 'continue now')
```

@@ -26,2 +31,2 @@

MIT
MIT

@@ -1,7 +0,5 @@

'use strict'
import { test } from 'tap'
import match from './index.js'
import { PassThrough } from 'stream'
const { test } = require('tap')
const match = require('.')
const { PassThrough } = require('stream')
test('pattern', async t => {

@@ -8,0 +6,0 @@ const stream = new PassThrough()