html-metadata-resolver

1.1.1 • Public • Published

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'
}]

Package Sidebar

Install

npm i html-metadata-resolver

Weekly Downloads

1

Version

1.1.1

License

MIT

Last publish

Collaborators

  • a.trubitsyn