Socket
Book a DemoInstallSign in
Socket

url-metadata-parser

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-metadata-parser

Request an http(s) url and scrape its metadata

npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

Metadata Parser

Request an http(s) url and scrape its metadata. It requires node-html-parser

Install

npm install url-metadata-parser

Usage

Promise-based:

import {UrlMetadataParser} from 'url-metadata-parser';
UrlMetadataParser.parse('https://www.google.com').toPromise().then(metadata => {
  const description = metadata.getContentByPropertyName('description');
  console.log('Here, Google website description', description);
});

Observable-based:

UrlMetadataParser.parse('https://www.google.com').subscribe(metadata => {
  const description = metadata.getContentByPropertyName('description');
  console.log('Here, Google website description', description);
});

API

  • getContentByPropertyName(propertyName: string)
  • getContentByName(name: string)
  • getNameByContent(content: string)

Where do I go for help?

If you need, open an issue.

Tests

npm test runs the jest tests.

npm run-script coverage runs the tests and reports code coverage.

Contributing

If you want to contribute to the project (awesome!!), just pull request.

Keywords

metadata

FAQs

Package last updated on 22 Apr 2019

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