key-value-transformer
TypeScript icon, indicating that this package has built-in type declarations

3.2.3 • Public • Published

npm License Typed with TypeScript bundlejs downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

key-value-transformer

Scans and 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

KeyValueUpdates

Type: Function

Parameters

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

Lines

Type: Function

Returns Iterable<string>

KeyValueTransformOptions

Type: Object

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 from value like '=' or ':'
  • keyValueLines Function to generate line(s) for a key value(s) pair
  • trailingLines Lines? lines coming after all key values have been written
  • headLines Lines? lines before all key values have been written

colonSeparatedKeyValuePairOptions

Type: Object

equalSeparatedKeyValuePairOptions

Type: Object

colonSeparatedKeyValuePairOptionsDoublingKeys

Type: Object

keyValueTransformer

Replaces key value pairs in a stream of lines.

Parameters

Returns AsyncIterable<string> lines with replaces key value pairs

install

With npm do:

npm install key-value-transformer

license

BSD-2-Clause

Readme

Keywords

Package Sidebar

Install

npm i key-value-transformer

Weekly Downloads

1,202

Version

3.2.3

License

BSD-2-Clause

Unpacked Size

16.8 kB

Total Files

5

Last publish

Collaborators

  • arlac77