stream-match
Advanced tools
+1
-5
@@ -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" | ||
| } | ||
| } |
+6
-1
@@ -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 |
+3
-5
@@ -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() |
3143
3.29%31
24%Yes
NaN79
-3.66%