https://github.com/afeiship/text2kv
Text array to kv list.
https://github.com/afeiship/text2kv
array kv label list pairs pure text value
Last synced: 3 months ago
JSON representation
Text array to kv list.
- Host: GitHub
- URL: https://github.com/afeiship/text2kv
- Owner: afeiship
- License: mit
- Created: 2016-10-19T10:06:06.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-20T06:33:03.000Z (over 2 years ago)
- Last Synced: 2025-05-22T22:10:10.131Z (5 months ago)
- Topics: array, kv, label, list, pairs, pure, text, value
- Language: TypeScript
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# text2kv
> Text array to kv list.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install @jswork/text2kv
```## usage
```js
import text2kv from '@jswork/text2kv';const arr = ['a', 'b', 'c'];
const result = text2kv(arr);/*
[
{ value: "a", label: "a" },
{ value: "b", label: "b" },
{ value: "c", label: "c" },
]
*/
```## license
Code released under [the MIT license](https://github.com/afeiship/text2kv/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/text2kv
[version-url]: https://npmjs.org/package/@jswork/text2kv[license-image]: https://img.shields.io/npm/l/@jswork/text2kv
[license-url]: https://github.com/afeiship/text2kv/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/text2kv
[size-url]: https://github.com/afeiship/text2kv/blob/master/dist/text2kv.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/text2kv
[download-url]: https://www.npmjs.com/package/@jswork/text2kv