Socket
Book a DemoInstallSign in
Socket

node-mercury-parser

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

node-mercury-parser

A promise based wrapper for Postlight's Mercury web parser.

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Node-Mercury-Parser

Overview

A promise-based Node wrapper around the [Mercury web parser] API.

Installation

Make sure you obtain an API key from https://mercury.postlight.com/web-parser/.

Install the package with:

npm install node-mercury-parser --save

How to use

const nodeMercuryParser = require('node-mercury-parser')
nodeMercuryParser.init(API_KEY)
nodeMercuryParser.get('http://www.cnn.com/2017/02/07/us/harambe-cheeto-trnd/')
  .then(res => res)
  .catch(err => err)

Available attributes

The API response exposes the following attributes, which allow you to access specific data from your HTML page and can be accessed like:

  nodeMercuryParser.title
  nodeMercuryParser.content
  nodeMercuryParser.date_published
  nodeMercuryParser.lead_image_url
  nodeMercuryParser.dek
  nodeMercuryParser.url
  nodeMercuryParser.domain
  nodeMercuryParser.excerpt
  nodeMercuryParser.word_count
  nodeMercuryParser.direction
  nodeMercuryParser.total_pages
  nodeMercuryParser.rendered_pages
  nodeMercuryParser.next_page_url

For more information about the underlying API visit

Mercury web parser

Keywords

mercury

FAQs

Package last updated on 10 Jun 2017

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.