@serialport/parser-regex
Advanced tools
Comparing version 10.2.2 to 10.3.0
/// <reference types="node" /> | ||
import { Transform, TransformCallback, TransformOptions } from 'stream'; | ||
export interface RegexParserOptions extends TransformOptions { | ||
/** The regular expression to use to split incoming text */ | ||
regex: RegExp | string | Buffer; | ||
/** Defaults to utf8 */ | ||
encoding?: BufferEncoding; | ||
} | ||
@@ -10,9 +13,2 @@ /** | ||
* To use the `Regex` parser provide a regular expression to split the incoming text upon. Data is emitted as string controllable by the `encoding` option (defaults to `utf8`). | ||
* | ||
* @example | ||
const SerialPort = require('serialport') | ||
const Regex = require('@serialport/parser-regex') | ||
const port = new SerialPort('/dev/tty-usbserial1') | ||
const parser = port.pipe(new Regex({ regex: /[\r\n]+/ })) | ||
parser.on('data', console.log) | ||
*/ | ||
@@ -19,0 +15,0 @@ export declare class RegexParser extends Transform { |
@@ -9,9 +9,2 @@ "use strict"; | ||
* To use the `Regex` parser provide a regular expression to split the incoming text upon. Data is emitted as string controllable by the `encoding` option (defaults to `utf8`). | ||
* | ||
* @example | ||
const SerialPort = require('serialport') | ||
const Regex = require('@serialport/parser-regex') | ||
const port = new SerialPort('/dev/tty-usbserial1') | ||
const parser = port.pipe(new Regex({ regex: /[\r\n]+/ })) | ||
parser.on('data', console.log) | ||
*/ | ||
@@ -18,0 +11,0 @@ class RegexParser extends stream_1.Transform { |
@@ -5,3 +5,3 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "10.2.2", | ||
"version": "10.3.0", | ||
"engines": { | ||
@@ -25,3 +25,3 @@ "node": ">=12.0.0" | ||
}, | ||
"gitHead": "e8be807d39ad084ffc7e8609693da5a94cf8a9cb" | ||
"gitHead": "ceba41c8f89d911de210f2513aaae85fff3ab457" | ||
} |
@@ -0,1 +1,3 @@ | ||
# @serialport/parser-regex | ||
See our api docs https://serialport.io/docs/api-parser-regex |
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
4
3958
61