key-value-transformer

Replaces key value pairs in a stream of lines

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
key-value-transformer
003.0.53 months agoa year agoMinified + gzip package size for key-value-transformer in KB

Readme

npm License Open Bundle downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status
key-value-transformer
Replaces key value pairs in a stream of lines
import { keyValueTransformer } from "key-value-transformer";

const input = getTextStream();
const output = keyValueTransformer(input, async * (key,value) => { yield [key, "newValue" ];})
API

Table of Contents

*   [Parameters](#parameters)
*   [Properties](#properties)
*   [Parameters](#parameters-1)

KeyValueUpdates

Type: Function

Parameters


Returns AsyncIterator<Array<string>> updated key and value pairs

KeyValueTransformOptions

Type: Objects

Properties

  • extractKeyValue Function 1st. line with key and value
  • extractValueContinuation
Function additional lines holding only values
  • lineEnding
  • string used to separate lines
  • keyValueSeparator
  • string chars to separate key vrom value like '=' or ':'
  • keyValueLines
  • Function to generate line(s) for a key value(s) pair
  • trailingLines
  • Iterator<string> lines coming after all key values have been written

    colonSeparatedKeyValuePairOptions

    equalSeparatedKeyValuePairOptions

    colonSeparatedKeyValuePairOptionsDoublingKeys

    keyValueTransformer

    Replaces key value pairs in a stream of lines.

    Parameters


    Returns AsyncIterator<string> lines with replaces key value pairs
    install
    With npm
    do:
    npm install key-value-transformer
    license
    BSD-2-Clause