Scans and replaces key value pairs in a stream of lines
npm install key-value-transformer










Scans and replaces key value pairs in a stream of lines
``js
import { keyValueTransformer } from "key-value-transformer";
const input = getTextStream();
const output = keyValueTransformer(input, async * (key,value) => { yield [key, "newValue" ];})
`
* KeyValueUpdates
* Parameters
* Lines
* KeyValueTransformOptions
* Properties
* colonSeparatedKeyValuePairOptions
* equalSeparatedKeyValuePairOptions
* colonSeparatedKeyValuePairOptionsDoublingKeys
* keyValueTransformer
* Parameters
Type: Function
* key string current keyvalue
* string current valuepresentKeys
* Set<string> the already seen keys
Returns AsyncIterable<Array<string>> updated key and value pairs
Type: Function
Returns Iterable<string>
Type: Object
* extractKeyValue Function 1st. line with key and valueextractValueContinuation
* Function additional lines holding only valueslineEnding
* string used to separate lineskeyValueSeparator
* string chars to separate key from value like '=' or ':'keyValueLines
* Lines to generate line(s) for a key value(s) pairtrailingLines
* Lines? lines coming after all key values have been writtenheadLines
* Lines? lines before all key values have been written
Type: KeyValueTransformOptions
Type: KeyValueTransformOptions
Type: KeyValueTransformOptions
Replaces key value pairs in a stream of lines.
* source AsyncIterable<string> input as linesupdates
* KeyValueUpdates options
* KeyValueTransformOptions (optional, default colonSeparatedKeyValuePairOptions)
Returns AsyncIterable<string> lines with replaces key value pairs
With npm do:
`shell``
npm install key-value-transformer
BSD-2-Clause