1.0.8 • Published 5 years ago

url-metadata-parser v1.0.8

Weekly downloads
31
License
ISC
Repository
-
Last release
5 years ago

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.

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago