kv-tag

1.0.0 • Public • Published

kv-tag

Convert template tags with key: value statements to objects.

npm travis standard conduct

About

This module is primarily a demonstration of creating a function to use as a tagged template literal.

You can use it convert a config-file like multiline string with key: value statements to an object.

Install

npm install --save kv-tag

Usage

var kv = require('kv-tag')
 
var a = 1
var b = 'hello hi hey'
var c = 3
 
var obj = kv`
  a: ${a}
  b: ${b}
  c: ${c}
`
 
console.log(obj)

The logged value is an object:

{
  a: 1,
  b: 'hello hi hey',
  c: 3
}

Contact

License

ISC

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

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

Package Sidebar

Install

npm i kv-tag

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • sethvincent