{"id":16698078,"url":"https://github.com/arlac77/key-value-transformer","last_synced_at":"2025-04-10T02:55:50.894Z","repository":{"id":37792892,"uuid":"436190790","full_name":"arlac77/key-value-transformer","owner":"arlac77","description":"Replaces key value pairs in a stream of lines","archived":false,"fork":false,"pushed_at":"2025-04-06T00:05:57.000Z","size":1457,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T00:24:20.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arlac77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-08T09:34:52.000Z","updated_at":"2025-04-06T00:06:00.000Z","dependencies_parsed_at":"2023-09-21T21:55:58.767Z","dependency_job_id":"24998e2c-d419-4ce8-ac87-aa4ef4e785b4","html_url":"https://github.com/arlac77/key-value-transformer","commit_stats":{"total_commits":335,"total_committers":3,"mean_commits":"111.66666666666667","dds":"0.30447761194029854","last_synced_commit":"e0b2825ea666a5954ef9693f47ac946167d3a7d1"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Fkey-value-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Fkey-value-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Fkey-value-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlac77%2Fkey-value-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arlac77","download_url":"https://codeload.github.com/arlac77/key-value-transformer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248147600,"owners_count":21055541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T17:50:41.196Z","updated_at":"2025-04-10T02:55:50.867Z","avatar_url":"https://github.com/arlac77.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/key-value-transformer.svg)](https://www.npmjs.com/package/key-value-transformer)\n[![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)\n[![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\\\u0026label\\\u0026labelColor=blue\\\u0026color=555555)](https://typescriptlang.org)\n[![bundlejs](https://deno.bundlejs.com/?q=key-value-transformer\\\u0026badge=detailed)](https://bundlejs.com/?q=key-value-transformer)\n[![downloads](http://img.shields.io/npm/dm/key-value-transformer.svg?style=flat-square)](https://npmjs.org/package/key-value-transformer)\n[![GitHub Issues](https://img.shields.io/github/issues/arlac77/key-value-transformer.svg?style=flat-square)](https://github.com/arlac77/key-value-transformer/issues)\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Fkey-value-transformer%2Fbadge\\\u0026style=flat)](https://actions-badge.atrox.dev/arlac77/key-value-transformer/goto)\n[![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/key-value-transformer/badge.svg)](https://snyk.io/test/github/arlac77/key-value-transformer)\n[![Coverage Status](https://coveralls.io/repos/arlac77/key-value-transformer/badge.svg)](https://coveralls.io/github/arlac77/key-value-transformer)\n\n# key-value-transformer\n\nScans and replaces key value pairs in a stream of lines\n\n```js\nimport { keyValueTransformer } from \"key-value-transformer\";\n\nconst input = getTextStream();\nconst output = keyValueTransformer(input, async * (key,value) =\u003e { yield [key, \"newValue\" ];})\n\n```\n\n# API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### Table of Contents\n\n*   [KeyValueUpdates](#keyvalueupdates)\n    *   [Parameters](#parameters)\n*   [Lines](#lines)\n*   [KeyValueTransformOptions](#keyvaluetransformoptions)\n    *   [Properties](#properties)\n*   [colonSeparatedKeyValuePairOptions](#colonseparatedkeyvaluepairoptions)\n*   [equalSeparatedKeyValuePairOptions](#equalseparatedkeyvaluepairoptions)\n*   [colonSeparatedKeyValuePairOptionsDoublingKeys](#colonseparatedkeyvaluepairoptionsdoublingkeys)\n*   [keyValueTransformer](#keyvaluetransformer)\n    *   [Parameters](#parameters-1)\n\n## KeyValueUpdates\n\nType: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)\n\n### Parameters\n\n*   `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** current key\n*   `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** current value\n*   `presentKeys` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** the already seen keys\n\nReturns **AsyncIterable\u003c[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e\u003e** updated key and value pairs\n\n## Lines\n\nType: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)\n\nReturns **Iterable\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\u0026#x20;\n\n## KeyValueTransformOptions\n\nType: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n### Properties\n\n*   `extractKeyValue` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** 1st. line with key and value\n*   `extractValueContinuation` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** additional lines holding only values\n*   `lineEnding` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** used to separate lines\n*   `keyValueSeparator` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** chars to separate key from value like '=' or ':'\n*   `keyValueLines` **[Lines](#lines)** to generate line(s) for a key value(s) pair\n*   `trailingLines` **[Lines](#lines)?** lines coming after all key values have been written\n*   `headLines` **[Lines](#lines)?** lines before all key values have been written\n\n## colonSeparatedKeyValuePairOptions\n\nType: [KeyValueTransformOptions](#keyvaluetransformoptions)\n\n## equalSeparatedKeyValuePairOptions\n\nType: [KeyValueTransformOptions](#keyvaluetransformoptions)\n\n## colonSeparatedKeyValuePairOptionsDoublingKeys\n\nType: [KeyValueTransformOptions](#keyvaluetransformoptions)\n\n## keyValueTransformer\n\nReplaces key value pairs in a stream of lines.\n\n### Parameters\n\n*   `source` **AsyncIterable\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** input lines\n*   `updates` **[KeyValueUpdates](#keyvalueupdates)**\u0026#x20;\n*   `options` **[KeyValueTransformOptions](#keyvaluetransformoptions)**  (optional, default `colonSeparatedKeyValuePairOptions`)\n\nReturns **AsyncIterable\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** lines with replaces key value pairs\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```shell\nnpm install key-value-transformer\n```\n\n# license\n\nBSD-2-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlac77%2Fkey-value-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farlac77%2Fkey-value-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlac77%2Fkey-value-transformer/lists"}