/html-attribute-parser

Primary LanguageJavaScriptMIT LicenseMIT

html-attribute-parser

NPM version Build Status Dependency Status Coverage percentage

Installation

  npm install --save html-attribute-parser

Usage

var htmlAttributeParser = require('html-attribute-parser');

let text = '<button attr class="btn btn-primary" id="submit" on-click="callFunction()">Hello world</button>';

let tag = htmlAttributeParser(text)
console.log(tag);

/* return
{ tagName: 'button',
  attributes: 
   { attr: true,
     class: 'btn btn-primary',
     id: 'submit',
     'on-click': 'callFunction()' },
  value: 'Hello world' }
*/

Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. Feel free to learn more about him.

Created with

Yeoman and Generator-simple-package

License

MIT © Nghia Tran