You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

url-meta-scraper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-meta-scraper

Get meta data from any url (http/https) and support group by property

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
475
3292.86%
Maintainers
1
Weekly downloads
 
Created
Source

url-meta-scraper

Get meta data from any url (http/https) and support group by property

Usage

Install

  • With npm
  npm install url-meta-scraper --save
  • With yarn
  yarn add url-meta-scraper --save

Example

  • Basic
  import { parser } from 'url-meta-scraper';
  const metaData = await parser(url)
  • If you'd like to override the default options:
  import { parser } from 'url-meta-scraper';
  const opts = {
    maxRedirects: 10,
    timeout: 10000,
    userAgent: 'your-agent',
    fromEmail: 'your-mail@example.com',
  }
  const metaData = await parser(url, opts)

Paramaters

  // The url to get meta data
  url: 'string',

Options

Package's default options are the values below, you can override it:

{
  // The package will follow a maximum of 10 redirects
  maxRedirects: 10,
  // Timeout of a request, default is 10 seconds:
  timeout: 10000,
  // The user agent and email that will make url request:
  userAgent: 'Metadata',
  fromEmail: 'metadata@example.com',
}

Returns

Returns a promise that gets resolved with the following url metadata and group by properties tag if the url request response returns successfully.

  {
    // This is includes meta data of the meta without property
    meta: {
      title: 'title',
      description: 'description',
      ...
    },
    // This is includes meta data of the meta with property
    og: {
      title: 'title',
      description: 'description',
      ...
    },
    ...
  }

Keywords

meta-tags

FAQs

Package last updated on 04 May 2022

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