JSPM

@jswork/str2kv

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 618
  • Score
    100M100P100Q119340F
  • License MIT

String to kv obj.

Package Exports

  • @jswork/str2kv
  • @jswork/str2kv/dist/cjs/index.js
  • @jswork/str2kv/dist/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jswork/str2kv) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.