html-metadata-resolver
v1.1.1
Published
A service for resolving meta tags attributes
Downloads
6
Maintainers
Readme
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'
}]