@jswork/str2kv
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

str2kv

String to kv obj.

version license size download

installation

npm install @jswork/str2kv

usage

import str2kv from '@jswork/str2kv';

// default saparator is [:/@]
const kmstr1 = '1id:value; 2id:value2; 3id:value3';
const obj1 = str2kv(km2str);
// { '1id': 'value', '2id': 'value2', '3id': 'value3' }

// custom saparator
const kmstr2 = '1id:value; 2id:value2; 3id:value3';
const obj2 = str2kv(km2str, ':');
// { '1id': 'value', '2id': 'value2', '3id': 'value3' }

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/str2kv

Homepage

js.work

Weekly Downloads

146

Version

1.0.1

License

MIT

Unpacked Size

5.01 kB

Total Files

7

Last publish

Collaborators

  • afeiship