1.1.1 • Published 6 years ago

html-metadata-resolver v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Build Status codecov

html-metadata-resolver

A service for resolving meta tags attributes

import {resolveMetadata} from 'html-metadata-resolver'

const html = `
    <!doctype html>
    <html>
      <head>
        <meta key="val">
        <meta val>
        <meta content='https://assets.somehost.com/resource.jpg' property='og:image'>
      </head>
    </html>
  `

console.log(resolveMetadata(html))

The result is:

[{
  key: 'val'
}, {
  val: ''
}, {
  content: 'https://assets.somehost.com/resource.jpg',
  property: 'og:image'
}]