html-attribute-parser

1.0.0 • Public • Published

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

/html-attribute-parser/

    Package Sidebar

    Install

    npm i html-attribute-parser

    Weekly Downloads

    333

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • nghiattran