This package has been deprecated

Author message:

Deprecating this in favor of https://www.npmjs.com/package/object-literal-parse

parse-keys-and-values-from-object-literal-strings

1.0.1 • Public • Published

Parse Keys And Values From Object Literal Strings

This library will turn a string like this:

'{ yeah : bro, no : dawg }'

Into:

[
    {
        key : 'yeah',
        value : 'bro'
    },
    {
        key : 'no',
        value : 'dawg'
    }
]

Thats it! Pretty cool huh?

Install it like so: npm install --save-dev parse-keys-and-values-from-object-literal-strings

I use it in my custom attribute library but it could be used in other places as well.

Inspiration: I was implementing something like this for my custom attribute library:

<div on-event='{ click : handleClick, mouseover : handleMouseOver, mouseOut : handleMouseOut }'></div>

Knockout.js does it. Angular does it. Jade does it. Ember does it. Why cant I do it too? Anyways, I reverse engineered it from knockout.js source code. Sue me.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i parse-keys-and-values-from-object-literal-strings

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • greglarrenaga