New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dkh-dev/html-metadata-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dkh-dev/html-metadata-parser

HTML Metadata Parser

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

html-metadata-parser

HTML Metadata Parser

Parser rules from mozilla/page-metadata-parser.

Installation

npm install @dkh-dev/html-metadata-parser

Examples

'use strict'

const { parse } = require('@dkh-dev/html-metadata-parser')

const url = 'https://github.com/'
const html = `
<!DOCTYPE html>
<html>

<head>
  <title>GitHub</title>
  <meta name="description" content="GitHub is where people build software.">
</head>

<!-- ... -->

</html>`

const main = async () => {
  const metadata = await parse(url, html)

  console.log(metadata)
  // => {
  //      url: 'https://github.com/',
  //      icon: 'https://github.com/favicon.ico',
  //      provider: 'github.com',
  //      title: 'GitHub',
  //      description: 'GitHub is where people build software.'
  //    }
}

main()

Keywords

metadata

FAQs

Package last updated on 25 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts