cskvpp

0.0.5 • Public • Published

Comma Separated Key-Value Pair Parser (cskvpp)

Small utility to stringify and parse comma separated key-value pairs

Example

import cskvpp from 'cskvpp'

const tags = 'hello=world,abc=123'

const parsedTags = cskvpp.parse(tags)

console.log(parsedTags) // { hello: "world", abc: 123 }

const stringified = cskvpp.stringify(parsedTags);

console.log(stringified); // "hello=world,abc=123"

Example with override

import cskvpp from 'cskvpp'

const tags = 'hello=world|abc=123'

const parsedTags = cskvpp.parse(tags, { separator: '|' })

console.log(parsedTags) // { hello: "world", abc: 123 }

const stringified = cskvpp.stringify(parsedTags, { joiner: '|' });

console.log(stringified); // "hello=world|abc=123"

Readme

Keywords

none

Package Sidebar

Install

npm i cskvpp

Weekly Downloads

7

Version

0.0.5

License

Apache-2.0

Last publish

Collaborators

  • andrewlively